mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-12 22:14:25 +00:00
netif: clean up remaining index shadowing from if APIs
This commit cleans up the remaining instance of global variable "index" shadowing caused by using local variables and function parameters named "index" These were introduced in the recent interface index API commits
This commit is contained in:
parent
d297d466ed
commit
fbfe987ae8
@ -1302,14 +1302,14 @@ netif_name_to_index(const char *name)
|
||||
* @param name char buffer of at least IF_NAMESIZE bytes
|
||||
*/
|
||||
char *
|
||||
netif_index_to_name(u8_t index, char *name)
|
||||
netif_index_to_name(u8_t idx, char *name)
|
||||
{
|
||||
struct netif *curif = netif_list;
|
||||
u8_t num;
|
||||
if (index == 0) {
|
||||
if (idx == 0) {
|
||||
return NULL; /* indexes start at 1 */
|
||||
}
|
||||
num = netif_index_to_num(index);
|
||||
num = netif_index_to_num(idx);
|
||||
|
||||
/* find netif from num */
|
||||
while (curif != NULL) {
|
||||
|
@ -492,7 +492,7 @@ err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t
|
||||
|
||||
/* @ingroup netif */
|
||||
u8_t netif_name_to_index(const char *name);
|
||||
char * netif_index_to_name(u8_t index, char *name);
|
||||
char * netif_index_to_name(u8_t idx, char *name);
|
||||
|
||||
/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 */
|
||||
#define netif_num_to_index(netif) ((netif)->num + 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user