diff options
-rw-r--r-- | lib/if.c | 1 | ||||
-rw-r--r-- | pimd/pim_cmd_common.c | 4 | ||||
-rw-r--r-- | tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py | 11 | ||||
-rw-r--r-- | zebra/interface.c | 3 |
4 files changed, 15 insertions, 4 deletions
@@ -1028,6 +1028,7 @@ void if_terminate(struct vrf *vrf) if (ifp->node) { ifp->node->info = NULL; route_unlock_node(ifp->node); + ifp->node = NULL; } if_delete(&ifp); } diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 75df09ec3..5b905a953 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -2747,7 +2747,7 @@ void pim_show_interfaces_single(struct pim_instance *pim, struct vty *vty, } } - if (!found_ifname) + if (!found_ifname && !json) vty_out(vty, "%% No such interface\n"); } @@ -3200,7 +3200,7 @@ void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty, } } - if (!found_neighbor) + if (!found_neighbor && !json) vty_out(vty, "%% No such interface or neighbor\n"); } diff --git a/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py b/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py index 8058823ba..75e66566b 100644 --- a/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py +++ b/tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py @@ -26,6 +26,7 @@ from time import sleep from lib.topogen import Topogen, get_topogen from lib.topojson import build_config_from_json from lib.topolog import logger +from lib import topotest from lib.bgp import ( verify_bgp_convergence, @@ -1559,8 +1560,14 @@ def test_verify_default_originate_with_2way_ecmp_p2(request): step("Ping R1 configure IPv4 and IPv6 loopback address from R2") pingaddr = topo["routers"]["r1"]["links"]["lo"]["ipv4"].split("/")[0] router = tgen.gears["r2"] - output = router.run("ping -c 4 -w 4 {}".format(pingaddr)) - assert " 0% packet loss" in output, "Ping R1->R2 FAILED" + + def ping_router(): + output = router.run("ping -c 4 -w 4 {}".format(pingaddr)) + logger.info(output) + if " 0% packet loss" not in output: + return False + + _, res = topotest.run_and_expect(ping_router, None, count=10, wait=1) logger.info("Ping from R1 to R2 ... success") step("Shuting up the active route") diff --git a/zebra/interface.c b/zebra/interface.c index 231ddc51d..ccf1a0a20 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -267,6 +267,9 @@ struct interface *if_link_per_ns(struct zebra_ns *ns, struct interface *ifp) /* Delete a VRF. This is called in vrf_terminate(). */ void if_unlink_per_ns(struct interface *ifp) { + if (!ifp->node) + return; + ifp->node->info = NULL; route_unlock_node(ifp->node); ifp->node = NULL; |