]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IPv6: Use "header+payload length" in two messages
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 4 Mar 2024 12:53:31 +0000 (13:53 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 4 Mar 2024 13:05:27 +0000 (14:05 +0100)
It seems a more logical order than "payload+header".

It is not in current release 4.99.4, will be in 4.99.5.

Update some test outputs accordingly.

print-ip6.c
tests/cve2015-0261-ipv6.out
tests/ipv6-too-long-jumbo.out
tests/ipv6_invalid_length_2.out
tests/ipv6_jumbogram_invalid_length.out
tests/quic_32_bit_pointer_overflow.out

index 460795c744af0138cf9c2f73d7c59372d4eb89be..d32278df03aa0eb9f8cdcfb77b9102f652e87263 100644 (file)
@@ -275,7 +275,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)
        if (payload_len != 0) {
                len = payload_len + sizeof(struct ip6_hdr);
                if (len > length) {
-                       ND_PRINT("[payload+header length %u > length %u]",
+                       ND_PRINT("[header+payload length %u > length %u]",
                                 len, length);
                        nd_print_invalid(ndo);
                        ND_PRINT(" ");
@@ -435,7 +435,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)
                                if (len < total_advance)
                                        goto trunc;
                                if (len > length) {
-                                       ND_PRINT("[payload+header length %u > length %u]",
+                                       ND_PRINT("[header+payload length %u > length %u]",
                                                 len, length);
                                        nd_print_invalid(ndo);
                                        ND_PRINT(" ");
index d2ca3c19694bce8b71ddf81584b6a14450678730..7cbc53bcbe138e3b78ca2f557c64dcf70ae9755a 100644 (file)
@@ -1,2 +1,2 @@
-    1  13:55:31.300000 IP6 [payload+header length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135) payload length: 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:6767:6767:6767:6767:6767:6705: mobility: BU seq#=26471 HL lifetime=105884(type-0x67: len=103) [|mobility]
-    2  15:21:11.300000 IP6 [payload+header length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135) payload length: 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:4f67:6767:6767:6767:6767:6767: (header length 8 is too small for type 6) [|mobility]
+    1  13:55:31.300000 IP6 [header+payload length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135) payload length: 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:6767:6767:6767:6767:6767:6705: mobility: BU seq#=26471 HL lifetime=105884(type-0x67: len=103) [|mobility]
+    2  15:21:11.300000 IP6 [header+payload length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135) payload length: 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:4f67:6767:6767:6767:6767:6767: (header length 8 is too small for type 6) [|mobility]
index d40d66018bea46cd3ca1f5548d5c03f78193c3a8..cfb7b14a46a3eba8e51a6c24e76ae3eb2b4af163 100644 (file)
@@ -1 +1 @@
-    1  12:40:23.226395 IP6 (class 0xc0, hlim 0, next-header Options (0) payload length: 0) 1:6:1a28:312:d7cb:b318:34e5:d3ea > 2b7f:cd1f:ec3c:fb9c:e731:d16b:a8fe:ba8c: HBH (opt_type 0x1a: len=0)(padn)(opt_type 0x16: len=0)(opt_type 0x64: len=114)(jumbo: 3858694210) (opt_type 0x42: len=3)(opt_type 0xfe: len=6)(pad1)(jumbo: 248 - already seen) (opt_type 0x0e: len=8)(opt_type 0x07: len=4)(opt_type 0xf1: len=60) [payload+header length 3858694250 > length 476] (invalid)  ip-proto-12 3858693802
+    1  12:40:23.226395 IP6 (class 0xc0, hlim 0, next-header Options (0) payload length: 0) 1:6:1a28:312:d7cb:b318:34e5:d3ea > 2b7f:cd1f:ec3c:fb9c:e731:d16b:a8fe:ba8c: HBH (opt_type 0x1a: len=0)(padn)(opt_type 0x16: len=0)(opt_type 0x64: len=114)(jumbo: 3858694210) (opt_type 0x42: len=3)(opt_type 0xfe: len=6)(pad1)(jumbo: 248 - already seen) (opt_type 0x0e: len=8)(opt_type 0x07: len=4)(opt_type 0xf1: len=60) [header+payload length 3858694250 > length 476] (invalid)  ip-proto-12 3858693802
index a91d604b74efe5a58c55a6fd84a5862f90eefb1b..f7cbc57c9c70b86ef7ae10426bdd11e40c3586e1 100644 (file)
@@ -1 +1 @@
-    1  08:59:14.753767 IP6 [payload+header length 105 > length 104] (invalid) (flowlabel 0x67576, hlim 64, next-header UDP (17) payload length: 65) 2605:bc80:3010:104::8cd3:9ce.45678 > 2600:3c00:e000:19::1.53: [udp sum ok] 34053+ [1au] A? www.tcpdump.org. (56)
+    1  08:59:14.753767 IP6 [header+payload length 105 > length 104] (invalid) (flowlabel 0x67576, hlim 64, next-header UDP (17) payload length: 65) 2605:bc80:3010:104::8cd3:9ce.45678 > 2600:3c00:e000:19::1.53: [udp sum ok] 34053+ [1au] A? www.tcpdump.org. (56)
index 6bb08a0abb28036dd7ec116b2a4702911fa7eaca..cfcef738ba76df8e083dabcee5b886138af96558 100644 (file)
@@ -1 +1 @@
-    1  09:09:55.627421 IP6 (hlim 227, next-header Options (0) payload length: 0) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: HBH (jumbo: 65537)  [payload+header length 65577 > length 65576] (invalid) ICMP6, echo request, id 4576, seq 51486
+    1  09:09:55.627421 IP6 (hlim 227, next-header Options (0) payload length: 0) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: HBH (jumbo: 65537)  [header+payload length 65577 > length 65576] (invalid) ICMP6, echo request, id 4576, seq 51486
index f456b6a29bbb16f3d9038b9638059e1166e2e894..9d2611b87ab42b231f556a86c5d1a6c94a3e10dc 100644 (file)
@@ -1 +1 @@
-    1  14:32:46.453540455 IP6 ::8:46:ee:102:202:202 > 202:200:0:fe7e:b65f:677a:82b:601: HBH [payload+header length 201311194 > length 58451] (invalid) 0 > 443: quic, initial, vb2a10200, dcid 00000100, length 1 [|quic]
+    1  14:32:46.453540455 IP6 ::8:46:ee:102:202:202 > 202:200:0:fe7e:b65f:677a:82b:601: HBH [header+payload length 201311194 > length 58451] (invalid) 0 > 443: quic, initial, vb2a10200, dcid 00000100, length 1 [|quic]