aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ll_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ll_map.c')
-rw-r--r--lib/ll_map.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 5addf4a4..b8b49aa1 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -161,6 +161,7 @@ unsigned ll_name_to_index(const char *name)
static int icache;
struct idxmap *im;
int i;
+ unsigned idx;
if (name == NULL)
return 0;
@@ -176,7 +177,10 @@ unsigned ll_name_to_index(const char *name)
}
}
- return if_nametoindex(name);
+ idx = if_nametoindex(name);
+ if (idx == 0)
+ sscanf(name, "if%u", &idx);
+ return idx;
}
int ll_init_map(struct rtnl_handle *rth)