linux/tools/testing/selftests/net/ipv6_flowlabel.sh
Alan Brady 16576a034c ping: support ipv6 ping socket flow labels
Ping sockets don't appear to make any attempt to preserve flow labels
created and set by userspace using IPV6_FLOWINFO_SEND. Instead they are
clobbered by autolabels (if enabled) or zero.

Grab the flowlabel out of the msghdr similar to how rawv6_sendmsg does
it and move the memset up so it doesn't get zeroed after.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-07-22 12:40:27 +01:00

38 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Regression tests for IPv6 flowlabels
#
# run in separate namespaces to avoid mgmt db conflicts betweent tests
set -e
echo "TEST management"
./in_netns.sh ./ipv6_flowlabel_mgr
echo "TEST datapath"
./in_netns.sh \
sh -c 'sysctl -q -w net.ipv6.auto_flowlabels=0 && ./ipv6_flowlabel -l 1'
echo "TEST datapath (with auto-flowlabels)"
./in_netns.sh \
sh -c 'sysctl -q -w net.ipv6.auto_flowlabels=1 && ./ipv6_flowlabel -l 1'
echo "TEST datapath (with ping-sockets)"
./in_netns.sh \
sh -c 'sysctl -q -w net.ipv6.flowlabel_reflect=4 && \
sysctl -q -w net.ipv4.ping_group_range="0 2147483647" && \
./ipv6_flowlabel -l 1 -p'
echo "TEST datapath (with flowinfo-send)"
./in_netns.sh \
sh -c './ipv6_flowlabel -l 1 -s'
echo "TEST datapath (with ping-sockets flowinfo-send)"
./in_netns.sh \
sh -c 'sysctl -q -w net.ipv6.flowlabel_reflect=4 && \
sysctl -q -w net.ipv4.ping_group_range="0 2147483647" && \
./ipv6_flowlabel -l 1 -p -s'
echo OK. All tests passed