1
1

Change the return type to handle the case where an invalid interface name is passed to this function.

This commit was SVN r20933.
Этот коммит содержится в:
Nysal Jan 2009-04-02 18:35:09 +00:00
родитель 9b7ab92de9
Коммит ab18a3629f
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -865,7 +865,7 @@ int opal_ifnametoindex(const char* if_name)
* corresponding kernel index. * corresponding kernel index.
*/ */
uint16_t opal_ifnametokindex(const char* if_name) int16_t opal_ifnametokindex(const char* if_name)
{ {
opal_if_t* intf; opal_if_t* intf;
int rc = opal_ifinit(); int rc = opal_ifinit();
@ -1230,7 +1230,7 @@ opal_ifnametoindex(const char* if_name)
return OPAL_ERR_NOT_SUPPORTED; return OPAL_ERR_NOT_SUPPORTED;
} }
uint16_t int16_t
opal_ifnametokindex(const char* if_name) opal_ifnametokindex(const char* if_name)
{ {
return OPAL_ERR_NOT_SUPPORTED; return OPAL_ERR_NOT_SUPPORTED;

Просмотреть файл

@ -77,7 +77,7 @@ OPAL_DECLSPEC int opal_ifnametoindex(const char* if_name);
* @param if_name (IN) Interface name * @param if_name (IN) Interface name
* @return Interface kernel index * @return Interface kernel index
*/ */
OPAL_DECLSPEC uint16_t opal_ifnametokindex(const char* if_name); OPAL_DECLSPEC int16_t opal_ifnametokindex(const char* if_name);
/** /**
* Lookup an interface by opal_list index and return its kernel index. * Lookup an interface by opal_list index and return its kernel index.