Browse Source

bgpd: check return value of zebra_interface_state_read

zebra_interface_state_read can return NULL in cornercases. The other
daemons check for this, so should bgpd.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Christian Franke 3 years ago
parent
commit
708ea62f82
1 changed files with 3 additions and 0 deletions
  1. 3 0
      bgpd/bgp_zebra.c

+ 3 - 0
bgpd/bgp_zebra.c

@@ -107,6 +107,9 @@ bgp_interface_delete (int command, struct zclient *zclient,
 
   s = zclient->ibuf;
   ifp = zebra_interface_state_read (s, vrf_id);
+  if (! ifp)
+    return 0;
+
   ifp->ifindex = IFINDEX_INTERNAL;
 
   if (BGP_DEBUG(zebra, ZEBRA))