[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZLgJKo09Z3idzAr5@shredder>
Date: Wed, 19 Jul 2023 19:02:50 +0300
From: Ido Schimmel <idosch@...sch.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Thomas Haller <thaller@...hat.com>
Subject: Re: [PATCHv2 net] ipv6: do not match device when remove source route
On Wed, Jul 19, 2023 at 05:54:49PM +0800, Hangbin Liu wrote:
> +ipv6_del_addr_test()
> +{
> + echo
> + echo "IPv6 delete address route tests"
> +
> + setup
> +
> + set -e
> + $IP li add dummy1 type dummy
> + $IP li set dummy1 up
> + $IP li add dummy2 type dummy
> + $IP li set dummy2 up
> + $IP li add red type vrf table 1111
> + $IP li set red up
> + $IP ro add vrf red unreachable default
> + $IP li set dummy2 vrf red
> +
> + $IP addr add dev dummy1 2001:db8:104::1/64
> + $IP addr add dev dummy1 2001:db8:104::11/64
> + $IP addr add dev dummy1 2001:db8:104::12/64
> + $IP addr add dev dummy1 2001:db8:104::13/64
> + $IP addr add dev dummy2 2001:db8:104::1/64
> + $IP addr add dev dummy2 2001:db8:104::11/64
> + $IP addr add dev dummy2 2001:db8:104::12/64
> + $IP route add 2001:db8:105::/64 via 2001:db8:104::2 src 2001:db8:104::11
> + $IP route add 2001:db8:106::/64 dev lo src 2001:db8:104::12
> + $IP route add table 0 2001:db8:107::/64 via 2001:db8:104::2 src 2001:db8:104::13
> + $IP route add vrf red 2001:db8:105::/64 via 2001:db8:104::2 src 2001:db8:104::11
> + $IP route add vrf red 2001:db8:106::/64 dev lo src 2001:db8:104::12
> + set +e
> +
> + # removing address from device in vrf should only remove route from vrf table
removing address from device in vrf should only remove it as a preferred
source address from routes in vrf table
> + echo " Regular FIB info"
> +
> + $IP addr del dev dummy2 2001:db8:104::11/64
> + # Checking if the source address exist instead of the dest subnet
s/exist/exists/
> + # as IPv6 only remove the preferred source address, not whole route.
s/remove/removes/
> + $IP -6 ro ls vrf red | grep -q 2001:db8:104::11
I prefer "src 2001:db8:104::11". Same in other places.
> + log_test $? 1 "Route removed from VRF when source address deleted"
Unlike IPv4, the route is not removed so maybe "Preferred source address
removed ..." (or something similar). Same in other places.
> +
> + $IP -6 ro ls | grep -q 2001:db8:104::11
> + log_test $? 0 "Route in default VRF not removed"
> +
> + $IP addr add dev dummy2 2001:db8:104::11/64
> + $IP route replace vrf red 2001:db8:105::/64 via 2001:db8:104::2 src 2001:db8:104::11
> +
> + $IP addr del dev dummy1 2001:db8:104::11/64
> + $IP -6 ro ls | grep -q 2001:db8:104::11
> + log_test $? 1 "Route removed in default VRF when source address deleted"
> +
> + $IP -6 ro ls vrf red | grep -q 2001:db8:104::11
> + log_test $? 0 "Route in VRF is not removed by address delete"
> +
> + # removing address from device in vrf should only remove route from vrf
> + # table even when the associated fib info only differs in table ID
Likewise, route not remove.
> + echo " Identical FIB info with different table ID"
> +
> + $IP addr del dev dummy2 2001:db8:104::12/64
> + $IP -6 ro ls vrf red | grep -q 2001:db8:104::12
> + log_test $? 1 "Route removed from VRF when source address deleted"
> +
> + $IP -6 ro ls | grep -q 2001:db8:104::12
> + log_test $? 0 "Route in default VRF not removed"
> +
> + $IP addr add dev dummy2 2001:db8:104::12/64
> + $IP route replace vrf red 2001:db8:106::/64 dev lo src 2001:db8:104::12
> +
> + $IP addr del dev dummy1 2001:db8:104::12/64
> + $IP -6 ro ls | grep -q 2001:db8:104::12
> + log_test $? 1 "Route removed in default VRF when source address deleted"
> +
> + $IP -6 ro ls vrf red | grep -q 2001:db8:104::12
> + log_test $? 0 "Route in VRF is not removed by address delete"
> +
> + # removing address from device in default vrf should remove route from
> + # the default vrf even when route was inserted with a table ID of 0.
Likewise.
> + echo " Table ID 0"
> +
> + $IP addr del dev dummy1 2001:db8:104::13/64
> + $IP -6 ro ls | grep -q 2001:db8:104::13
> + log_test $? 1 "Route removed in default VRF when source address deleted"
> +
> + $IP li del dummy1
> + $IP li del dummy2
> + cleanup
> +}
Powered by blists - more mailing lists