]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IPv6: Print 'No Next Header' when relevant
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 11 Feb 2025 13:39:52 +0000 (14:39 +0100)
committerfxlb <[email protected]>
Wed, 12 Feb 2025 07:02:06 +0000 (07:02 +0000)
This avoids to print 'next-header unknown (59)' when it's the first
header.

Add a test file.

ipproto.c
tests/TESTLIST
tests/ipv6_no_next_header.out [new file with mode: 0644]
tests/ipv6_no_next_header.pcap [new file with mode: 0644]

index b3266e5d05864ed1a4c3561d3fbba4fe6e09de60..2000a2f42f433dca480b9f9bea3d92aea86a42fc 100644 (file)
--- a/ipproto.c
+++ b/ipproto.c
@@ -39,6 +39,7 @@ const struct tok ipproto_values[] = {
     { IPPROTO_AH, "AH" },
     { IPPROTO_MOBILE, "Mobile IP" },
     { IPPROTO_ICMPV6, "ICMPv6" },
     { IPPROTO_AH, "AH" },
     { IPPROTO_MOBILE, "Mobile IP" },
     { IPPROTO_ICMPV6, "ICMPv6" },
+    { IPPROTO_NONE, "No Next Header" },
     { IPPROTO_DSTOPTS, "DSTOPT" },
     { IPPROTO_MOBILITY_OLD, "Mobile IP (old)" },
     { IPPROTO_EIGRP, "EIGRP" },
     { IPPROTO_DSTOPTS, "DSTOPT" },
     { IPPROTO_MOBILITY_OLD, "Mobile IP (old)" },
     { IPPROTO_EIGRP, "EIGRP" },
index d1abd13f9111318155791f944a8d1c76efee660f..a036e6d7ac276df35a33019f3c3cc0055cd0538b 100644 (file)
@@ -405,6 +405,7 @@ ipv6_jumbogram_invalid_length ipv6_jumbogram_invalid_length.pcap ipv6_jumbogram_
 ipv6_39_byte_header ipv6_39_byte_header.pcap ipv6_39_byte_header.out -v
 ipv6_missing_jumbo_payload_option ipv6_missing_jumbo_payload_option.pcap ipv6_missing_jumbo_payload_option.out
 ipv6_frag6_negative_len ipv6_frag6_negative_len.pcap ipv6_frag6_negative_len.out -v
 ipv6_39_byte_header ipv6_39_byte_header.pcap ipv6_39_byte_header.out -v
 ipv6_missing_jumbo_payload_option ipv6_missing_jumbo_payload_option.pcap ipv6_missing_jumbo_payload_option.out
 ipv6_frag6_negative_len ipv6_frag6_negative_len.pcap ipv6_frag6_negative_len.out -v
+ipv6_no_next_header ipv6_no_next_header.pcap ipv6_no_next_header.out -v
 
 # Loopback/CTP test case
 loopback       loopback.pcap           loopback.out
 
 # Loopback/CTP test case
 loopback       loopback.pcap           loopback.out
diff --git a/tests/ipv6_no_next_header.out b/tests/ipv6_no_next_header.out
new file mode 100644 (file)
index 0000000..aa1057d
--- /dev/null
@@ -0,0 +1 @@
+    1  2025-02-11 13:31:22.134532 IP6 (hlim 64, next-header No Next Header (59), payload length 20) 2005::1 > 2008::1: no next header
diff --git a/tests/ipv6_no_next_header.pcap b/tests/ipv6_no_next_header.pcap
new file mode 100644 (file)
index 0000000..b450796
Binary files /dev/null and b/tests/ipv6_no_next_header.pcap differ