]> The Tcpdump Group git mirrors - tcpdump/commit
IPv6: Fix inconsistencies in the printing of some option names
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 31 Oct 2024 10:50:08 +0000 (11:50 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Nov 2024 08:32:51 +0000 (09:32 +0100)
commit21753e3cd68802a07ea32a72cd21aaefe41e4c08
treee8336bfc577e0822773468dafd0aeef9fa4d84ac
parent813b972e6a4127fc88f435b415db48d530cd1aac
IPv6: Fix inconsistencies in the printing of some option names

1) Hop-by-Hop Options Header

$ ./tcpdump --skip 1 -c1 -tnv -r tests/icmpv6.pcap
Before:
IP6 (hlim 1, next-header Options (0), payload length 36)
  fe80::215:17ff:fecc:e546 > ff02::16: HBH (rtalert: 0x0000) (padn)
  [icmp6 sum ok] ICMP6, [...]

There is "next-header Options" but the next header is printed "HBH".

After:
IP6 (hlim 1, next-header HBH (0), payload length 36)
  fe80::215:17ff:fecc:e546 > ff02::16: HBH (rtalert: 0x0000) (padn)
  [icmp6 sum ok] ICMP6, [...]

2) Destination Options Header

$ ./tcpdump  -tnv -r tests/erspan-type-iii-pb-1.pcap
Before:
IP6 (class 0x30, flowlabel 0x00001, hlim 1, next-header unknown (60),
  payload length 288) 4120:7467:1700:4200:143:100:7f01:400e >
  4591:bfd7:cd87:d7:68:38:101:e800: DSTOPT (padn) [...]

There is "next-header unknown" but next header is printed "DSTOPT".

After:
IP6 (class 0x30, flowlabel 0x00001, hlim 1, next-header DSTOPT (60),
  payload length 288) 4120:7467:1700:4200:143:100:7f01:400e >
  4591:bfd7:cd87:d7:68:38:101:e800: DSTOPT (padn) [...]

Moreover:
Update a ndo_protocol (s/hbhopt/hbh/).
Use nd_print_protocol_caps().

Update some test outputs accordingly.

(backported from commit 803b7028e04b757c5351a300a905e326c7d5a200)
14 files changed:
ipproto.c
print-ip6opts.c
tests/babel1v.out
tests/cve2015-0261-crash.out
tests/dcb_ets.out
tests/dcb_qcn.out
tests/icmpv6.out
tests/ipv6-next-header-oobr-1.out
tests/ipv6-next-header-oobr-2.out
tests/ipv6-too-long-jumbo.out
tests/ipv6_jumbogram_1.out
tests/ipv6_jumbogram_invalid_length.out
tests/ipv6hdr-heapoverflow-v.out
tests/ipv6hdr-heapoverflow.out