Merge pull request #13631 from donaldsharp/fix_some_ping_issues

various issues
This commit is contained in:
Donatas Abraitis 2023-05-30 21:26:24 +03:00 committed by GitHub
commit 147c7a2de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 4 deletions

View File

@ -1028,6 +1028,7 @@ void if_terminate(struct vrf *vrf)
if (ifp->node) { if (ifp->node) {
ifp->node->info = NULL; ifp->node->info = NULL;
route_unlock_node(ifp->node); route_unlock_node(ifp->node);
ifp->node = NULL;
} }
if_delete(&ifp); if_delete(&ifp);
} }

View File

@ -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"); 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"); vty_out(vty, "%% No such interface or neighbor\n");
} }

View File

@ -26,6 +26,7 @@ from time import sleep
from lib.topogen import Topogen, get_topogen from lib.topogen import Topogen, get_topogen
from lib.topojson import build_config_from_json from lib.topojson import build_config_from_json
from lib.topolog import logger from lib.topolog import logger
from lib import topotest
from lib.bgp import ( from lib.bgp import (
verify_bgp_convergence, 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") step("Ping R1 configure IPv4 and IPv6 loopback address from R2")
pingaddr = topo["routers"]["r1"]["links"]["lo"]["ipv4"].split("/")[0] pingaddr = topo["routers"]["r1"]["links"]["lo"]["ipv4"].split("/")[0]
router = tgen.gears["r2"] router = tgen.gears["r2"]
def ping_router():
output = router.run("ping -c 4 -w 4 {}".format(pingaddr)) output = router.run("ping -c 4 -w 4 {}".format(pingaddr))
assert " 0% packet loss" in output, "Ping R1->R2 FAILED" 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") logger.info("Ping from R1 to R2 ... success")
step("Shuting up the active route") step("Shuting up the active route")

View File

@ -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(). */ /* Delete a VRF. This is called in vrf_terminate(). */
void if_unlink_per_ns(struct interface *ifp) void if_unlink_per_ns(struct interface *ifp)
{ {
if (!ifp->node)
return;
ifp->node->info = NULL; ifp->node->info = NULL;
route_unlock_node(ifp->node); route_unlock_node(ifp->node);
ifp->node = NULL; ifp->node = NULL;