Skip to content

Commit

Permalink
selftests: forwarding: add helper for retrieving IPv6 link-local addr…
Browse files Browse the repository at this point in the history
…ess of interface

Pinging an IPv6 link-local multicast address selects the link-local
unicast address of the interface as source, and we'd like to monitor for
that in tcpdump.

Add a helper to the forwarding library which retrieves the link-local
IPv6 address of an interface, to make that task easier.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Apr 23, 2022
1 parent f23cddc commit a5114df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/testing/selftests/net/forwarding/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,15 @@ mac_get()
ip -j link show dev $if_name | jq -r '.[]["address"]'
}

ipv6_lladdr_get()
{
local if_name=$1

ip -j addr show dev $if_name | \
jq -r '.[]["addr_info"][] | select(.scope == "link").local' | \
head -1
}

bridge_ageing_time_get()
{
local bridge=$1
Expand Down

0 comments on commit a5114df

Please sign in to comment.