[frr] [PATCH 09/11] bgpd: sanity check against accessing invalid table pointer.

Philippe Guibert philippe.guibert at 6wind.com
Wed Dec 21 09:13:54 EST 2016


This sanity check has been discovered when running bgp mpath_tests
that are available in tests folder.

Signed-off-by: Philippe Guibert <philippe.guibert at 6wind.com>
---
 bgpd/bgp_mpath.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 034116f193ce..f2e6bba11d1a 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -466,7 +466,9 @@ bgp_info_mpath_update (struct bgp_node *rn, struct bgp_info *new_best,
         mpath_cfg->maxpaths_ibgp : mpath_cfg->maxpaths_ebgp;
     }
 
-  if (bgp_node_table (rn)->type == BGP_TABLE_VRF)
+  if (rn->table &&
+      bgp_node_table (rn) &&
+      bgp_node_table (rn)->type == BGP_TABLE_VRF)
     {
       struct prefix_rd *prd = &bgp_node_table (rn)->prd;
       if (new_best)
-- 
2.1.4





More information about the dev mailing list