Commit 7a5e9d84 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

selftests: fib_nexthops: Test cleanup of FDB entries following nexthop deletion



Commit c7cdbe2e ("vxlan: support for nexthop notifiers") registered
a listener in the VXLAN driver to the nexthop notification chain. Its
purpose is to cleanup FDB entries that use a nexthop that is being
deleted.

Test that such FDB entries are removed when the nexthop group that they
use is deleted. Test that entries are not deleted when a single nexthop
in the group is deleted.

Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0695564b
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -411,9 +411,16 @@ ipv6_fdb_grp_fcnal()
	run_cmd "$IP -6 ro add 2001:db8:101::1/128 nhid 103"
	log_test $? 2 "Route add with fdb nexthop group"

	run_cmd "$IP nexthop del id 61"
	run_cmd "$BRIDGE fdb get to 02:02:00:00:00:13 dev vx10 self"
	log_test $? 0 "Fdb entry after deleting a single nexthop"

	run_cmd "$IP nexthop del id 102"
	log_test $? 0 "Fdb nexthop delete"

	run_cmd "$BRIDGE fdb get to 02:02:00:00:00:13 dev vx10 self"
	log_test $? 254 "Fdb entry after deleting a nexthop group"

	$IP link del dev vx10
}

@@ -484,9 +491,16 @@ ipv4_fdb_grp_fcnal()
	run_cmd "$IP ro add 172.16.0.0/22 nhid 103"
	log_test $? 2 "Route add with fdb nexthop group"

	run_cmd "$IP nexthop del id 12"
	run_cmd "$BRIDGE fdb get to 02:02:00:00:00:13 dev vx10 self"
	log_test $? 0 "Fdb entry after deleting a single nexthop"

	run_cmd "$IP nexthop del id 102"
	log_test $? 0 "Fdb nexthop delete"

	run_cmd "$BRIDGE fdb get to 02:02:00:00:00:13 dev vx10 self"
	log_test $? 254 "Fdb entry after deleting a nexthop group"

	$IP link del dev vx10
}