Subject: kern/32900: Full-size packets get truncated by 4 bytes when using vlan(4).
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <ndehne@gmail.com>
List: netbsd-bugs
Date: 02/22/2006 13:15:00
>Number:         32900
>Category:       kern
>Synopsis:       Full-size packets get truncated by 4 bytes when using vlan(4).
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 22 13:15:00 +0000 2006
>Originator:     Nino Dehne
>Release:        3.99.15
>Organization:
>Environment:
NetBSD [...] 3.99.15 NetBSD 3.99.15 (WRAP) #0: Sun Feb 19 11:45:01 CET 2006  [...]:/var/tmp/wrap/HEAD/obj/sys/arch/i386/compile/WRAP i386
>Description:
As described in http://mail-index.netbsd.org/tech-net/2006/02/21/0004.html I'm having trouble with a router using vlan(4), although this only affects connections from the box itself. Routed connections are fine.

After using tcpdump directly on the affected machine, I noticed the following:

13:36:01.390654 IP 192.168.1.254.65523 > 192.168.1.1.80: S 242548566:242548566(0) win 32768 <mss 1460,nop,wscale 0,sackOK,nop,nop,nop,nop,timestamp 0 0>
13:36:01.390962 IP 192.168.1.1.80 > 192.168.1.254.65523: S 3516973584:3516973584(0) ack 242548567 win 32768 <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0>
13:36:01.391282 IP 192.168.1.254.65523 > 192.168.1.1.80: . ack 1 win 33580 <nop,nop,timestamp 0 0>
13:36:01.392253 IP 192.168.1.254.65523 > 192.168.1.1.80: P 1:102(101) ack 1 win 33580 <nop,nop,timestamp 0 0>
13:36:01.394594 IP 192.168.1.1.80 > 192.168.1.254.65523: P 1:246(245) ack 102 win 33580 <nop,nop,timestamp 0 0>
13:36:01.394869 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 246:1694(1448) ack 102 win 33580 <nop,nop,timestamp 0 0>
13:36:01.394959 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 1694:3142(1448) ack 102 win 33580 <nop,nop,timestamp 0 0>
13:36:01.395078 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 3142:4590(1448) ack 102 win 33580 <nop,nop,timestamp 0 0>
13:36:01.395201 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 4590:6038(1448) ack 102 win 33580 <nop,nop,timestamp 0 0>
13:36:01.594307 IP 192.168.1.254.65523 > 192.168.1.1.80: . ack 246 win 33580 <nop,nop,timestamp 0 0>
13:36:01.594653 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 6038:7486(1448) ack 102 win 33580 <nop,nop,timestamp 1 0>
13:36:01.594754 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 7486:8934(1448) ack 102 win 33580 <nop,nop,timestamp 1 0>
13:36:03.093197 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 246:1694(1448) ack 102 win 33580 <nop,nop,timestamp 4 0>
13:36:05.093337 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 246:1694(1448) ack 102 win 33580 <nop,nop,timestamp 8 0>
13:36:07.444286 IP 192.168.1.254.65523 > 192.168.1.1.80: F 102:102(0) ack 246 win 33580 <nop,nop,timestamp 12 0>
13:36:07.444612 IP 192.168.1.1.80 > 192.168.1.254.65523: . ack 103 win 33580 <nop,nop,timestamp 12 12>
13:36:09.093657 IP truncated-ip - 4 bytes missing! 192.168.1.1.80 > 192.168.1.254.65523: . 246:1694(1448) ack 103 win 33580 <nop,nop,timestamp 16 12>

This didn't show up on the switch port the router is connected to, so I guess this must be happening on the box itself, i.e. the switch (Level1 GSW-2472TGX) should not be the problem.

Somehow 4 bytes get lost in full-size frames. I'm afraid that's all I can do to diagnose the problem.

Please help. If you need more info, I can provide.
>How-To-Repeat:
Setup vlan(4) and do a large transfer via e.g. HTTP. Use tcpdump on the vlan interface and watch the "truncated-ip - 4 bytes missing!" messages.
>Fix: