Commit c1d6d629 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by Jakub Kicinski
Browse files

selftests/net: prepare cmsg_ipv6.sh for ipv4



Move IPV6_TCLASS and IPV6_HOPLIMIT into loops, to be able to use them
for IP_TOS and IP_TTL in a follow-on patch.

Indentation in this file is a mix of four spaces and tabs for double
indents. To minimize code churn, maintain that pattern.

Very small diff if viewing with -w.

Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250225022431.2083926-2-willemdebruijn.kernel@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3ba07527
Loading
Loading
Loading
Loading
+59 −50
Original line number Diff line number Diff line
@@ -64,8 +64,10 @@ for ovr in setsock cmsg both diff; do
done

# IPV6_TCLASS
TOS=0x10
TOS2=0x20

test_dscp() {
    local -r TOS=0x10
    local -r TOS2=0x20

    ip -6 -netns $NS rule add tos $TOS lookup 300
    ip -6 -netns $NS route add table 300 prohibit any
@@ -103,9 +105,13 @@ for ovr in setsock cmsg both diff; do
	    check_result $? 1 "TCLASS $prot $ovr - rejection"
	done
    done
}

test_dscp

# IPV6_HOPLIMIT
LIM=4
test_hoplimit() {
    local -r LIM=4

    for ovr in setsock cmsg both diff; do
	for p in u i r; do
@@ -134,6 +140,9 @@ for ovr in setsock cmsg both diff; do
	    rm $TMPF
	done
    done
}

test_hoplimit

# IPV6 exthdr
for p in u i r; do