++ id -u + '[' 0 '!=' 0 ']' + which tcpdump + expected_tos=0x00 + expected_ttl=0 + failed=false + printf ┌────────┬───────┬───────┬──────────────┬ ┌────────┬───────┬───────┬──────────────┬+ printf '──────────────┬───────┬────────┐\n' ──────────────┬───────┬────────┐ + for type in gre vxlan geneve ++ modprobe gre + for outer in 4 6 + printf ├────────┼───────┼───────┼──────────────┼ ├────────┼───────┼───────┼──────────────┼+ printf '──────────────┼───────┼────────┤\n' ──────────────┼───────┼────────┤ + printf '│ Type │ outer | inner │ tos │' │ Type │ outer | inner │ tos │+ printf ' ttl │ vlan │ result │\n' ttl │ vlan │ result │ + for inner in 4 6 other + printf ├────────┼───────┼───────┼──────────────┼ ├────────┼───────┼───────┼──────────────┼+ printf '──────────────┼───────┼────────┤\n' ──────────────┼───────┼────────┤ + for tos_ttl in inherit random + for vlan in false true + setup gre 4 4 inherit false + local type=gre + local outer=4 + local inner=4 + local tos_ttl=inherit + local vlan=false + local test_tos=0x00 + local test_ttl=0 + local 'ns=ip netns exec testing' ++ get_random_tos +++ tr -dc 0-9a-f +++ head -c 1 +++ tr -dc 048c +++ head -c 1 ++ echo 0x98 + expected_tos=0x98 + '[' 0x98 = 0x00 ']' + '[' inherit = random ']' + '[' inherit = inherit ']' + test_tos=inherit + tos='inherit 0x98' ++ get_random_ttl +++ tr -dc 0-9a-f +++ head -c 2 ++ printf %d 0xa6 + expected_ttl=166 + '[' 166 = 64 ']' + '[' 166 = 0 ']' + '[' inherit = random ']' + '[' inherit = inherit ']' + test_ttl=inherit + ttl='inherit 166' + printf '│%7s │%6s │%6s │%13s │%13s │%6s │' gre 4 4 'inherit 0x98' 'inherit 166' false │ gre │ 4 │ 4 │ inherit 0x98 │ inherit 166 │ false │+ ip netns add testing Cannot create namespace file "/var/run/netns/testing": File exists + ip link add type veth + ip link set veth1 netns testing RTNETLINK answers: File exists + ip link set veth0 up + ip netns exec testing ip link set veth1 up + ip addr flush dev veth0 + ip netns exec testing ip addr flush dev veth1 + local local_addr1= + local local_addr2= + '[' gre = gre ']' + '[' 4 = 4 ']' + local_addr1='local 198.18.0.1' + local_addr2='local 198.18.0.2' + local vxlan= + '[' gre = vxlan ']' + local geneve= + '[' gre = geneve ']' + '[' 4 = 4 ']' + '[' gre = gre ']' + type=gretap + ip addr add 198.18.0.1/24 dev veth0 + ip netns exec testing ip addr add 198.18.0.2/24 dev veth1 + ip link add name tep0 type gretap local 198.18.0.1 remote 198.18.0.2 tos inherit ttl inherit RTNETLINK answers: File exists + ip netns exec testing ip link add name tep1 type gretap local 198.18.0.2 remote 198.18.0.1 tos inherit ttl inherit RTNETLINK answers: File exists + ip link set tep0 up + ip netns exec testing ip link set tep1 up + ip addr flush dev tep0 + ip netns exec testing ip addr flush dev tep1 + local parent + false + parent=tep + '[' 4 = 4 ']' + ip addr add 198.19.0.1/24 brd + dev tep0 + ip netns exec testing ip addr add 198.19.0.2/24 brd + dev tep1 + verify 4 4 inherit false + local outer=4 + local inner=4 + local tos_ttl=inherit + local vlan=false + local ping_pid out captured_tos captured_ttl result + local ping_dst + '[' 4 = 4 ']' + ping_dst=198.19.0.2 + '[' inherit = inherit ']' + ping_pid=353289 + local tunnel_type_offset tunnel_type_proto req_proto_offset req_offset + '[' gre = gre ']' + tunnel_type_proto=0x2f + '[' 4 = 4 ']' + tunnel_type_offset=9 + '[' 4 = 4 ']' + req_proto_offset=47 + ping -i 0.1 198.19.0.2 -Q 0x98 -t 166 + req_offset=58 + '[' gre = vxlan ']' + '[' gre = geneve ']' + false ++ tcpdump --immediate-mode -p -c 1 -v -i veth0 -n 'ip[9]' = 0x2f and 'ip[47]' = 0x01 and 'ip[58]' = 0x08 ++ head -n 1