]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix crash in vnc_import_bgp_add_route
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 2 Oct 2016 22:33:32 +0000 (18:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 2 Oct 2016 22:33:32 +0000 (18:33 -0400)
The ordering to check for NULL pointer was
reversed in this function.

I switched the order after examing a couple other
functions to see that they have the 'correct' order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/rfapi/vnc_import_bgp.c

index 99ec9efb264136264d5a677cdf873afc34814ff6..4215ce2bf78d5a27121d94221eb4cd3b0275f90b 100644 (file)
@@ -2837,18 +2837,17 @@ vnc_import_bgp_del_route (
 #endif
   VNC_RHNCK (enter);
 
-  /* check bgp redist flag for vnc direct ("vpn") routes */
-
-  if (!bgp->rfapi_cfg->redist[afi][ZEBRA_ROUTE_BGP_DIRECT])
+  if (!bgp->rfapi_cfg)
     {
-      zlog_debug ("%s: bgp redistribution of afi=%d VNC direct routes is off",
-                  __func__, afi);
+      zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
       return;
     }
 
-  if (!bgp->rfapi_cfg)
+  /* check bgp redist flag for vnc direct ("vpn") routes */
+  if (!bgp->rfapi_cfg->redist[afi][ZEBRA_ROUTE_BGP_DIRECT])
     {
-      zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
+      zlog_debug ("%s: bgp redistribution of afi=%d VNC direct routes is off",
+                  __func__, afi);
       return;
     }