platinasystems / go

Other
9 stars 68 forks source link

dhcp punted packets have a zero vlan tag even with no vlans configured #92

Closed stigt closed 6 years ago

stigt commented 6 years ago

Notice vlan tag 0:

19:51:37.602290 02:46:8a:00:03:02 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 346: vlan 0, p 0, ethertype IPv4, (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 02:46:8a:00:03:02, length 300, xid 0x4cbc75b, Flags [none] (0x0000) Client-Ethernet-Address 02:46:8a:00:03:02 Vendor-rfc1048 Extensions Magic Cookie 0x63825363 DHCP-Message Option 53, length 1: Request Server-ID Option 54, length 4: 192.168.120.10 Requested-IP Option 50, length 4: 192.168.120.20 Hostname Option 12, length 2: "R1" Parameter-Request Option 55, length 13: Subnet-Mask, BR, Time-Zone, Default-Gateway Domain-Name, Domain-Name-Server, Option 119, Hostname Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route NTP END Option 255, length 0 PAD Option 0, length 0, occurs 25

Punted ping packets do NOT have the vlan tag:

19:58:12.883326 02:46:8a:00:03:02 > 02:46:8a:00:02:fe, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 39807, offset 0, flags [DF], proto ICMP (1), length 84) 192.168.120.20 > 192.168.120.10: ICMP echo request, id 29, seq 0, length 64

19:58:12.883353 02:46:8a:00:02:fe > 02:46:8a:00:03:02, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 30853, offset 0, flags [none], proto ICMP (1), length 84) 192.168.120.10 > 192.168.120.20: ICMP echo reply, id 29, seq 0, length 64

stigt commented 6 years ago

There is now a test case for this issue:

stig@invader1:~/go/src/github.com/platinasystems/go/main/goes-platina-mk1$ sudo ./goes-platina-mk1.test -test.vv -test.run ./net/dhcp/eth --- FAIL: Test (17.74s) docker.go:53: Docker client version 1.33 --- FAIL: Test/net (11.19s) --- FAIL: Test/net/dhcp (11.19s) --- FAIL: Test/net/dhcp/eth (11.19s) dhcp.go:20: Image stigt/debian-dhcpc:latest found local docker.go:308: Starting container R1 docker.go:378: moving eth-25-0 to container R1 with address 192.168.120.5/24 dhcp.go:20: Image stigt/debian-dhcps:latest found local docker.go:308: Starting container R2 docker.go:378: moving eth-24-0 to container R2 with address 192.168.120.10/24 --- FAIL: Test/net/dhcp/eth/vlan_tag (1.17s) dhcp.go:105: Check for invalid vlan tag dhcp.go:128: Invalid vlan 0 tag found docker.go:397: moving eth-25-0 from R1 to default docker.go:336: Stopping container R1 docker.go:397: moving eth-24-0 from R2 to default docker.go:336: Stopping container R2 main_test.go:108: killed main_test.go:108: listen: /run/goes/socks/redisd listen: [127.0.0.1%lo]:6379 listen: [::1%lo]:6379 listen: [192.168.101.121%eth0]:6379 listen: [fe80::46:8aff:fe00:2a0%eth0]:6379 killed FAIL

fszyang commented 6 years ago

Fixed with (coming from external port to CPU) commit 4ac321f0a629702acd63758476489e6e211b5072 in go and (going from CPU to external port) commit 1c82f232b9b4ccaf88843116a35fc6e3ad918709 in fe1