summaryrefslogtreecommitdiff
path: root/zebra/interface.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-04-30 10:26:06 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-05-01 09:19:47 -0300
commitb8af3fbbafc83b22c3215f3eb97a6465324cc10a (patch)
tree55eb163625af8fa0df6db8012a30f9efcaee5e0d /zebra/interface.h
parentd5414843c2f5173be2bf76c179eece0620313fd4 (diff)
zebra: fix detection of interface renames
Restore the original logic in netlink_link_change() which works like this: * once an interface event is detected, lookup the associated interface by its name; * call the set_ifindex() function; * set_ifindex() will lookup the interface again but now by its ifindex. If the lookups by name and ifindex yield to different results, then the interface was renamed and set_ifindex() will take care of that. In the future, zns->if_table will be split into two different data structures to allow faster lookups by both name and ifindex. Fixes Issue #397. Regression introduced by commit 12f6fb9. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/interface.h')
-rw-r--r--zebra/interface.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/interface.h b/zebra/interface.h
index 6039e2d379..9f108760d6 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -236,6 +236,7 @@ struct zebra_if
extern struct interface *if_lookup_by_index_per_ns (struct zebra_ns *, u_int32_t);
+extern struct interface *if_lookup_by_name_per_ns (struct zebra_ns *, const char *);
extern struct interface *if_link_per_ns (struct zebra_ns *, struct interface *);
extern const char *ifindex2ifname_per_ns (struct zebra_ns *, unsigned int);