Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions print-ip6.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,23 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)

/*
* OK, we didn't see any extension
* header, but that means we have
* no payload, so set the length
* to the IPv6 header length,
* header - presume BIG TCP without
* a Jumbo Payload option, but only
* if it's actually >64k. Otherwise,
* we have no payload, so set the
* length to the IPv6 header length,
* and change the snapshot length
* accordingly.
*/
len = sizeof(struct ip6_hdr);
nd_change_snaplen(ndo, bp, len);
if (length > 65535) {
len = length;
if (ndo->ndo_vflag)
ND_PRINT("[real length %u, presumed BIG TCP] ",
len);
} else {
len = sizeof(struct ip6_hdr);
nd_change_snaplen(ndo, bp, len);
}

/*
* Now subtract the length of
Expand Down
24 changes: 24 additions & 0 deletions tests/TESTLIST
Original file line number Diff line number Diff line change
Expand Up @@ -1053,3 +1053,27 @@ LINKTYPE_IPV6_invalid-e LINKTYPE_IPV6_invalid.pcap LINKTYPE_IPV6_invalid-e.out -
# ipv6_mobility_1.pcap is built with scapy
ipv6_mobility_1 ipv6_mobility_1.pcap ipv6_mobility_1.out
ipv6_mobility_1-v ipv6_mobility_1.pcap ipv6_mobility_1-v.out -v

# Aggregation offloads (GSO, BIG TCP)
gso-ipv4 gso-ipv4.pcap gso-ipv4.out -v
gso-ipv4-geneve-ipv4 gso-ipv4-geneve-ipv4.pcap gso-ipv4-geneve-ipv4.out -v
gso-ipv4-geneve-ipv6 gso-ipv4-geneve-ipv6.pcap gso-ipv4-geneve-ipv6.out -v
gso-ipv4-vxlan-ipv4 gso-ipv4-vxlan-ipv4.pcap gso-ipv4-vxlan-ipv4.out -v
gso-ipv4-vxlan-ipv6 gso-ipv4-vxlan-ipv6.pcap gso-ipv4-vxlan-ipv6.out -v
gso-ipv6 gso-ipv6.pcap gso-ipv6.out -v
gso-ipv6-geneve-ipv4 gso-ipv6-geneve-ipv4.pcap gso-ipv6-geneve-ipv4.out -v
gso-ipv6-geneve-ipv6 gso-ipv6-geneve-ipv6.pcap gso-ipv6-geneve-ipv6.out -v
gso-ipv6-vxlan-ipv4 gso-ipv6-vxlan-ipv4.pcap gso-ipv6-vxlan-ipv4.out -v
gso-ipv6-vxlan-ipv6 gso-ipv6-vxlan-ipv6.pcap gso-ipv6-vxlan-ipv6.out -v
bigtcp-ipv4 bigtcp-ipv4.pcap bigtcp-ipv4.out -v
bigtcp-ipv4-geneve-ipv4 bigtcp-ipv4-geneve-ipv4.pcap bigtcp-ipv4-geneve-ipv4.out -v
bigtcp-ipv4-geneve-ipv6 bigtcp-ipv4-geneve-ipv6.pcap bigtcp-ipv4-geneve-ipv6.out -v
bigtcp-ipv4-vxlan-ipv4 bigtcp-ipv4-vxlan-ipv4.pcap bigtcp-ipv4-vxlan-ipv4.out -v
bigtcp-ipv4-vxlan-ipv6 bigtcp-ipv4-vxlan-ipv6.pcap bigtcp-ipv4-vxlan-ipv6.out -v
bigtcp-ipv6 bigtcp-ipv6.pcap bigtcp-ipv6.out -v
bigtcp-ipv6-hbh bigtcp-ipv6-hbh.pcap bigtcp-ipv6-hbh.out -v
bigtcp-ipv6-geneve-ipv4 bigtcp-ipv6-geneve-ipv4.pcap bigtcp-ipv6-geneve-ipv4.out -v
bigtcp-ipv6-geneve-ipv6 bigtcp-ipv6-geneve-ipv6.pcap bigtcp-ipv6-geneve-ipv6.out -v
bigtcp-ipv6-vxlan-ipv4 bigtcp-ipv6-vxlan-ipv4.pcap bigtcp-ipv6-vxlan-ipv4.out -v
bigtcp-ipv6-vxlan-ipv6 bigtcp-ipv6-vxlan-ipv6.pcap bigtcp-ipv6-vxlan-ipv6.out -v
icmp-length-zero icmp-length-zero.pcap icmp-length-zero.out -v
4 changes: 4 additions & 0 deletions tests/bigtcp-ipv4-geneve-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 2025-10-03 14:04:08.505389 IP (tos 0x0, ttl 61, id 44946, offset 0, flags [none], proto UDP (17), length 80102 [was 0, presumed TSO])
10.25.132.11.29804 > 10.25.132.13.6081: Geneve, Flags [none], vni 0x1389
IP (tos 0x0, ttl 64, id 3511, offset 0, flags [DF], proto TCP (6), length 80052 [was 0, presumed TSO])
192.168.1.2.35663 > 192.168.1.1.38005: Flags [P.], cksum 0xbbfb (incorrect -> 0xe8f3), seq 341409049:341489049, ack 461929438, win 325, options [nop,nop,TS val 3707257633 ecr 891304888], length 80000
Binary file added tests/bigtcp-ipv4-geneve-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/bigtcp-ipv4-geneve-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 14:03:56.656908 IP (tos 0x0, ttl 61, id 27215, offset 0, flags [none], proto UDP (17), length 80122 [was 0, presumed TSO])
10.25.132.11.60614 > 10.25.132.13.6081: Geneve, Flags [none], vni 0x1389
IP6 (flowlabel 0x75c1b, hlim 64, next-header TCP (6), payload length 0) [real length 80072, presumed BIG TCP] fd00::2.40433 > fd00::1.41423: Flags [P.], cksum 0x32ac (incorrect -> 0xe0f8), seq 79142004:79222004, ack 3545221731, win 319, options [nop,nop,TS val 1489592988 ecr 3996598946], length 80000
Binary file added tests/bigtcp-ipv4-geneve-ipv6.pcap
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/bigtcp-ipv4-vxlan-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 2025-10-02 15:12:35.180627 IP (tos 0x0, ttl 61, id 28457, offset 0, flags [none], proto UDP (17), length 80102 [was 0, presumed TSO])
10.25.132.11.47044 > 10.25.132.13.4789: VXLAN, flags [I] (0x08), vni 5001
IP (tos 0x0, ttl 64, id 31532, offset 0, flags [DF], proto TCP (6), length 80052 [was 0, presumed TSO])
192.168.1.2.36875 > 192.168.1.1.36449: Flags [P.], cksum 0xbbfb (incorrect -> 0xad1f), seq 497210414:497290414, ack 1007986268, win 370, options [nop,nop,TS val 3624964308 ecr 809011563], length 80000
Binary file added tests/bigtcp-ipv4-vxlan-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/bigtcp-ipv4-vxlan-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-02 15:12:54.704284 IP (tos 0x0, ttl 61, id 59958, offset 0, flags [none], proto UDP (17), length 80046 [was 0, presumed TSO])
10.25.132.11.60879 > 10.25.132.13.4789: VXLAN, flags [I] (0x08), vni 5001
IP6 (flowlabel 0xac0c4, hlim 64, next-header TCP (6), payload length 0) [real length 79996, presumed BIG TCP] fd00::2.33673 > fd00::1.36425: Flags [P.], cksum 0x3260 (incorrect -> 0xb98b), seq 1339751239:1339831163, ack 3942433666, win 373, options [nop,nop,TS val 1407331035 ecr 3914336993], length 79924
Binary file added tests/bigtcp-ipv4-vxlan-ipv6.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/bigtcp-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-02 15:05:40.030951 IP (tos 0x0, ttl 64, id 12031, offset 0, flags [DF], proto TCP (6), length 80052 [was 0, presumed TSO])
10.25.132.13.35871 > 10.25.132.11.36425: Flags [P.], cksum 0x54f2 (incorrect -> 0x199e), seq 4155358606:4155438606, ack 17023525, win 635, options [nop,nop,TS val 3921144597 ecr 3152931631], length 80000
Binary file added tests/bigtcp-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/bigtcp-ipv6-geneve-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 14:05:41.755329 IP6 (hlim 61, next-header UDP (17), payload length 0) [real length 80122, presumed BIG TCP] 2604:1380:4091:ce00::b.55411 > 2604:1380:4091:ce00::d.6081: [bad udp cksum 0xc928 -> 0xb00c!] Geneve, Flags [none], vni 0x1389
IP (tos 0x0, ttl 64, id 14015, offset 0, flags [DF], proto TCP (6), length 80052 [was 0, presumed TSO])
192.168.1.2.43959 > 192.168.1.1.39887: Flags [P.], cksum 0xbbfb (incorrect -> 0x0e24), seq 3918632444:3918712444, ack 4091711457, win 338, options [nop,nop,TS val 3707350883 ecr 891398138], length 80000
Binary file added tests/bigtcp-ipv6-geneve-ipv4.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/bigtcp-ipv6-geneve-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-03 14:05:54.176759 IP6 (hlim 64, next-header UDP (17), payload length 0) [real length 80142, presumed BIG TCP] 2604:1380:4091:ce00::d.23733 > 2604:1380:4091:ce00::b.6081: [bad udp cksum 0xc93c -> 0x5da5!] Geneve, Flags [none], vni 0x1389
IP6 (flowlabel 0xe4292, hlim 64, next-header TCP (6), payload length 0) [real length 80072, presumed BIG TCP] fd00::1.38339 > fd00::2.43997: Flags [P.], cksum 0x32ac (incorrect -> 0x61d4), seq 1386091372:1386171372, ack 3439981244, win 367, options [nop,nop,TS val 3996716466 ecr 1489710507], length 80000
Binary file added tests/bigtcp-ipv6-geneve-ipv6.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/bigtcp-ipv6-hbh.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2025-10-06 14:13:27.172200 IP6 (flowlabel 0xa31ee, hlim 64, next-header HBH (0), payload length 0) 2604:1380:4091:ce00::d > 2604:1380:4091:ce00::b: HBH (jumbo: 80040) 41851 > 43913: Flags [P.], cksum 0xc8eb (incorrect -> 0x3146), seq 592820498:592900498, ack 2512896041, win 2128, options [nop,nop,TS val 1186840160 ecr 4237097528], length 80000
Binary file added tests/bigtcp-ipv6-hbh.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/bigtcp-ipv6-vxlan-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-02 15:11:32.151342 IP6 (hlim 64, next-header UDP (17), payload length 0) [real length 80122, presumed BIG TCP] 2604:1380:4091:ce00::d.52238 > 2604:1380:4091:ce00::b.4789: [bad udp cksum 0xc928 -> 0xf351!] VXLAN, flags [I] (0x08), vni 5001
IP (tos 0x0, ttl 64, id 57048, offset 0, flags [DF], proto TCP (6), length 80052 [was 0, presumed TSO])
192.168.1.1.41873 > 192.168.1.2.38131: Flags [P.], cksum 0xbbfb (incorrect -> 0xe29f), seq 2347745286:2347825286, ack 3538766307, win 2495, options [nop,nop,TS val 808948535 ecr 3624901279], length 80000
Binary file added tests/bigtcp-ipv6-vxlan-ipv4.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/bigtcp-ipv6-vxlan-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-02 15:11:04.542102 IP6 (hlim 64, next-header UDP (17), payload length 0) [real length 80142, presumed BIG TCP] 2604:1380:4091:ce00::d.37059 > 2604:1380:4091:ce00::b.4789: [bad udp cksum 0xc93c -> 0x286f!] VXLAN, flags [I] (0x08), vni 5001
IP6 (flowlabel 0xbf7fd, hlim 64, next-header TCP (6), payload length 0) [real length 80072, presumed BIG TCP] fd00::1.40007 > fd00::2.40607: Flags [P.], cksum 0x32ac (incorrect -> 0xb3b0), seq 936978514:937058514, ack 729791262, win 368, options [nop,nop,TS val 3914226831 ecr 1407220872], length 80000
Binary file added tests/bigtcp-ipv6-vxlan-ipv6.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/bigtcp-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2025-10-02 15:09:21.939724 IP6 (flowlabel 0x81ccd, hlim 61, next-header TCP (6), payload length 0) [real length 80040, presumed BIG TCP] 2604:1380:4091:ce00::b.43267 > 2604:1380:4091:ce00::d.41219: Flags [P.], cksum 0xc8cb (incorrect -> 0x2ab4), seq 2265425561:2265505529, ack 3850636772, win 426, options [nop,nop,TS val 3564116459 ecr 3863151628], length 79968
Binary file added tests/bigtcp-ipv6.pcap
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/gso-ipv4-geneve-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 2025-10-03 16:29:23.634332 IP (tos 0x0, ttl 61, id 1208, offset 0, flags [none], proto UDP (17), length 7092)
10.25.132.11.5799 > 10.25.132.13.6081: Geneve, Flags [none], vni 0x1389
IP (tos 0x0, ttl 64, id 29210, offset 0, flags [DF], proto TCP (6), length 7042)
192.168.1.2.40769 > 192.168.1.1.37633: Flags [P.], cksum 0x9ec8 (incorrect -> 0x9dc7), seq 1260004295:1260011285, ack 2119234335, win 166, options [nop,nop,TS val 3715972762 ecr 900020017], length 6990
Binary file added tests/gso-ipv4-geneve-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/gso-ipv4-geneve-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 16:29:04.300378 IP (tos 0x0, ttl 61, id 2594, offset 0, flags [none], proto UDP (17), length 4256)
10.25.132.11.15130 > 10.25.132.13.6081: Geneve, Flags [none], vni 0x1389
IP6 (flowlabel 0x4cb3f, hlim 64, next-header TCP (6), payload length 4166) fd00::2.34235 > fd00::1.37399: Flags [.], cksum 0x0a51 (incorrect -> 0xeedb), seq 1812075153:1812079287, ack 1385650056, win 169, options [nop,nop,TS val 1498300631 ecr 4005306590], length 4134
Binary file added tests/gso-ipv4-geneve-ipv6.pcap
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/gso-ipv4-vxlan-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 2025-10-03 16:30:14.343441 IP (tos 0x0, ttl 61, id 12520, offset 0, flags [none], proto UDP (17), length 7092)
10.25.132.11.60345 > 10.25.132.13.4789: VXLAN, flags [I] (0x08), vni 5001
IP (tos 0x0, ttl 64, id 10282, offset 0, flags [DF], proto TCP (6), length 7042)
192.168.1.2.37099 > 192.168.1.1.41547: Flags [P.], cksum 0x9ec8 (incorrect -> 0x6674), seq 1925567864:1925574854, ack 2614339187, win 166, options [nop,nop,TS val 3716023471 ecr 900070726], length 6990
Binary file added tests/gso-ipv4-vxlan-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/gso-ipv4-vxlan-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 16:30:29.672424 IP (tos 0x0, ttl 61, id 20154, offset 0, flags [none], proto UDP (17), length 4256)
10.25.132.11.55123 > 10.25.132.13.4789: VXLAN, flags [I] (0x08), vni 5001
IP6 (flowlabel 0x83f92, hlim 64, next-header TCP (6), payload length 4166) fd00::2.44479 > fd00::1.40145: Flags [.], cksum 0x0a51 (incorrect -> 0x7fa9), seq 4240990499:4240994633, ack 3328482507, win 2489, options [nop,nop,TS val 1498386003 ecr 4005391962], length 4134
Binary file added tests/gso-ipv4-vxlan-ipv6.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/gso-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-03 16:26:52.155133 IP (tos 0x0, ttl 61, id 41110, offset 0, flags [DF], proto TCP (6), length 7292)
10.25.132.11.38407 > 10.25.132.13.39701: Flags [P.], cksum 0x38b9 (incorrect -> 0xb3af), seq 964901299:964908539, ack 2308918948, win 166, options [nop,nop,TS val 3244203756 ecr 4012416721], length 7240
Binary file added tests/gso-ipv4.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/gso-ipv6-geneve-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 16:28:10.433497 IP6 (hlim 61, next-header UDP (17), payload length 6972) 2604:1380:4091:ce00::b.22155 > 2604:1380:4091:ce00::d.6081: [bad udp cksum 0xab91 -> 0xdcc1!] Geneve, Flags [none], vni 0x1389
IP (tos 0x0, ttl 64, id 51474, offset 0, flags [DF], proto TCP (6), length 6942)
192.168.1.2.36991 > 192.168.1.1.41507: Flags [P.], cksum 0x9e64 (incorrect -> 0xb694), seq 1242530197:1242537087, ack 2919862022, win 169, options [nop,nop,TS val 3715899561 ecr 899946816], length 6890
Binary file added tests/gso-ipv6-geneve-ipv4.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/gso-ipv6-geneve-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-03 16:28:33.023345 IP6 (hlim 61, next-header UDP (17), payload length 6892) 2604:1380:4091:ce00::b.60561 > 2604:1380:4091:ce00::d.6081: [bad udp cksum 0xab41 -> 0xb221!] Geneve, Flags [none], vni 0x1389
IP6 (flowlabel 0x48db8, hlim 64, next-header TCP (6), payload length 6822) fd00::2.38687 > fd00::1.45505: Flags [P.], cksum 0x14b1 (incorrect -> 0xa8e0), seq 3469802238:3469809028, ack 2183910745, win 166, options [nop,nop,TS val 1498269354 ecr 4005275312], length 6790
Binary file added tests/gso-ipv6-geneve-ipv6.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/gso-ipv6-vxlan-ipv4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 2025-10-03 16:31:22.053904 IP6 (hlim 61, next-header UDP (17), payload length 6972) 2604:1380:4091:ce00::b.35971 > 2604:1380:4091:ce00::d.4789: [bad udp cksum 0xab91 -> 0x2867!] VXLAN, flags [I] (0x08), vni 5001
IP (tos 0x0, ttl 64, id 61850, offset 0, flags [DF], proto TCP (6), length 6942)
192.168.1.2.34737 > 192.168.1.1.42261: Flags [P.], cksum 0x9e64 (incorrect -> 0xd5cd), seq 459554290:459561180, ack 3104965599, win 169, options [nop,nop,TS val 3716091182 ecr 900138437], length 6890
Binary file added tests/gso-ipv6-vxlan-ipv4.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/gso-ipv6-vxlan-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-03 16:31:12.636043 IP6 (hlim 61, next-header UDP (17), payload length 4176) 2604:1380:4091:ce00::b.39902 > 2604:1380:4091:ce00::d.4789: [bad udp cksum 0xa0a5 -> 0xd93a!] VXLAN, flags [I] (0x08), vni 5001
IP6 (flowlabel 0xb986b, hlim 64, next-header TCP (6), payload length 4106) fd00::2.43583 > fd00::1.44175: Flags [.], cksum 0x0a15 (incorrect -> 0x07c8), seq 1840055637:1840059711, ack 989320780, win 166, options [nop,nop,TS val 1498428967 ecr 4005434925], length 4074
Binary file added tests/gso-ipv6-vxlan-ipv6.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gso-ipv6.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2025-10-03 16:27:33.363746 IP6 (flowlabel 0x6e481, hlim 61, next-header TCP (6), payload length 7172) 2604:1380:4091:ce00::b.36539 > 2604:1380:4091:ce00::d.45393: Flags [P.], cksum 0xac4e (incorrect -> 0xd25e), seq 1110639583:1110646723, ack 3034762532, win 169, options [nop,nop,TS val 3655207884 ecr 3954243053], length 7140
Binary file added tests/gso-ipv6.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/icmp-length-zero.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 2025-10-06 13:09:13.000001 IP (tos 0x0, ttl 61, id 19706, offset 0, flags [DF], proto ICMP (1), length 84 [was 0, presumed TSO])
10.25.132.11 > 10.25.132.13: ICMP echo request, id 12931, seq 1, length 64
Binary file added tests/icmp-length-zero.pcap
Binary file not shown.