Skip to content

Commit a5114df

Browse files
vladimirolteandavem330
authored andcommitted
selftests: forwarding: add helper for retrieving IPv6 link-local address 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>
1 parent f23cddc commit a5114df

File tree

1 file changed

+9
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+9
-0
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,15 @@ mac_get()
868868
ip -j link show dev $if_name | jq -r '.[]["address"]'
869869
}
870870

871+
ipv6_lladdr_get()
872+
{
873+
local if_name=$1
874+
875+
ip -j addr show dev $if_name | \
876+
jq -r '.[]["addr_info"][] | select(.scope == "link").local' | \
877+
head -1
878+
}
879+
871880
bridge_ageing_time_get()
872881
{
873882
local bridge=$1

0 commit comments

Comments
 (0)