Lou - A quick glance at the vnc code gives me this: rfapi_import.c: bgp = bgp_get_default (); /* assume 1 instance for now */ rfapi_import.c: bgp = bgp_get_default (); /* assume 1 instance for now */ With this code change am I just setting up the tests to fail at a different time? Does vnc need to be fixed to allow it to be run without a default bgp instance running? donald On Wed, Nov 30, 2016 at 9:58 AM, Lou Berger <lberger@labn.net> wrote:
Thanks!
On 11/30/2016 9:27 AM, Donald Sharp wrote:
When configuring multiple bgp views without a default bgp session, the code will crash.
This code change only fixes the crash from happening. I'm not entirely sure that the code will not misbehave with multiple bgp views and configuring vnc in this case.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> --- bgpd/rfapi/vnc_import_bgp.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 4215ce2..441bdee 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -1798,6 +1798,9 @@ vnc_import_bgp_exterior_add_route_it ( struct bgp *bgp_default = bgp_get_default (); afi_t afi = family2afi (prefix->family);
+ if (!bgp_default) + return; + h = bgp_default->rfapi; hc = bgp_default->rfapi_cfg;
@@ -1992,6 +1995,9 @@ vnc_import_bgp_exterior_del_route ( afi_t afi = family2afi (prefix->family); struct bgp *bgp_default = bgp_get_default ();
+ if (!bgp_default) + return; + memset (&pfx_orig_nexthop, 0, sizeof (struct prefix)); /* keep valgrind happy */
h = bgp_default->rfapi;