selftests: net: lib: Rename ip_route_add() to adf_*

Rename this function to mark it as autodefer.
For details, see the discussion in the cover letter.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/403143183373419e4a31df4665d6bfaa273eb761.1758821127.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Petr Machata 2025-09-25 19:31:50 +02:00 committed by Jakub Kicinski
parent 773603d6db
commit d85bcf6505
3 changed files with 6 additions and 6 deletions

View File

@ -47,8 +47,8 @@ host_create()
simple_if_init "$h" "$ipv4" "$ipv6"
defer simple_if_fini "$h" "$ipv4" "$ipv6"
ip_route_add vrf "v$h" 192.0.2.16/28 nexthop via 192.0.2.3
ip_route_add vrf "v$h" 2001:db8:2::/64 nexthop via 2001:db8:1::3
adf_ip_route_add vrf "v$h" 192.0.2.16/28 nexthop via 192.0.2.3
adf_ip_route_add vrf "v$h" 2001:db8:2::/64 nexthop via 2001:db8:1::3
}
h3_create()
@ -56,8 +56,8 @@ h3_create()
simple_if_init "$h3" 192.0.2.18/28 2001:db8:2::2/64
defer simple_if_fini "$h3" 192.0.2.18/28 2001:db8:2::2/64
ip_route_add vrf "v$h3" 192.0.2.0/28 nexthop via 192.0.2.17
ip_route_add vrf "v$h3" 2001:db8:1::/64 nexthop via 2001:db8:2::1
adf_ip_route_add vrf "v$h3" 192.0.2.0/28 nexthop via 192.0.2.17
adf_ip_route_add vrf "v$h3" 2001:db8:1::/64 nexthop via 2001:db8:2::1
tc qdisc add dev "$h3" clsact
defer tc qdisc del dev "$h3" clsact

View File

@ -68,7 +68,7 @@ switch_create()
adf_ip_link_set_up $rp1
adf_ip_addr_add $rp1 192.0.2.17/28
ip_route_add 192.0.2.32/28 nexthop via 192.0.2.18
adf_ip_route_add 192.0.2.32/28 nexthop via 192.0.2.18
adf_ip_link_set_master $swp1 br1
adf_ip_link_set_up $swp1

View File

@ -613,7 +613,7 @@ adf_ip_addr_add()
defer ip addr del dev "$name" "$@"
}
ip_route_add()
adf_ip_route_add()
{
ip route add "$@" && \
defer ip route del "$@"