From 2ad7c8ecb732c6a22b8a950ac27be28b3f51c720 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 4 Dec 2017 20:33:44 -0500 Subject: [PATCH] bgpd: Reorder assignment and assertion. If we ever turn off assertion for production builds this code as written will cause a crash in that the assignment will not happen. Modify the code such that this erroneous assumption cannot happen. Signed-off-by: Donald Sharp --- bgpd/rfapi/vnc_import_bgp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 05fbd18056..bec0b9e6c6 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -1183,7 +1183,8 @@ static void vnc_import_bgp_del_route_mode_nvegroup(struct bgp *bgp, assert(afi); - assert((rfg = bgp->rfapi_cfg->rfg_redist)); + rfg = bgp->rfapi_cfg->rfg_redist; + assert(rfg); /* * Compute VN address -- 2.39.5