summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-07-07 19:42:40 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-05-09 01:24:15 +0200
commit8cb73ba40d85ca8f93aa7f976399e8151dea9c8e (patch)
tree2d33ee24dec4b62b0d26865b24cdb9bfe0351e50 /zebra
parentbgpd: Fix compiler warning->errors of might be used uninited (diff)
downloadfrr-8cb73ba40d85ca8f93aa7f976399e8151dea9c8e.tar.xz
frr-8cb73ba40d85ca8f93aa7f976399e8151dea9c8e.zip
zebra: Fixup crash with vlan interfaces attempted to be used
When zebra starts up it receives from the kernel a full dump of interface information. Unfortunately it is in no particular order. As such we sometimes receive data from the kernel about interfaces we do not know about yet. In this bug, we are attempting to use the interface pointer(->link) for a vlan interface that we have not properly resolved. This fix ensures that we will not attempt to call zvni_map_svi if we have a NULL pointer. There are other places in the code we are already checking for the fact that the ->link pointer is valid before calling this function, so I believe that this is correct. We do need to come back and resolve all ->link pointers after we have received the full table. This can be done in another commit. Ticket: CM-17041 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/interface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 6f59a2d39..8d430be3e 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1224,8 +1224,13 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
br_slave->bridge_ifindex);
}
- if (zebra_if->link_ifindex != IFINDEX_INTERNAL)
- vty_out(vty, " Link ifindex %u\n", zebra_if->link_ifindex);
+ if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
+ vty_out(vty, " Link ifindex %u", zebra_if->link_ifindex);
+ if (zebra_if->link)
+ vty_out(vty, "(%s)\n", zebra_if->link->name);
+ else
+ vty_out(vty, "(Unknown)\n");
+ }
if (HAS_LINK_PARAMS(ifp)) {
int i;