ip addrlabel outputs if%d names due to missing init call:
$ ip addrlabel s
prefix a::42/128 dev if4 label 1000
Also, ip did not accept "if%d" interfaces on input.
Signed-off-by: Florian Westphal <fw@strlen.de>
int do_ipaddrlabel(int argc, char **argv)
{
+ ll_init_map(&rth);
+
if (argc < 1) {
return ipaddrlabel_list(0, NULL);
} else if (matches(argv[0], "list") == 0 ||
static int icache;
struct idxmap *im;
int i;
+ unsigned idx;
if (name == NULL)
return 0;
}
}
- 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)