summaryrefslogtreecommitdiff
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-04-22 13:15:01 +0300
committerVladimir Oltean <vladimir.oltean@nxp.com>2022-05-04 15:25:02 +0200
commitce511af6280b1e1da3d2bc74a8f163cf78cc198a (patch)
tree14d0cd60382327c1655aafc40ca8f66e227576b3 /tools/testing/selftests
parentbb7cc72f1f9dc216c16898120a6dd788cb228441 (diff)
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> (cherry picked from commit a5114df6c61336269558d3316079d25867716e64) Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/net/forwarding/lib.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 69d62a91503b..34f119dcf0c4 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -849,6 +849,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