You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net/packet
Brad Fitzpatrick c1a2e2c380 net/{packet,tstun},wgengine/filter: fix unknown IP protocol handling
01b90df2fa added SCTP support before
(with explicit parsing for ports) and
69de3bf7bf tried to add support for
arbitrary IP protocols (as long as the ACL permited a port of "*",
since we might not know how to find ports from an arbitrary IP
protocol, if it even has such a concept). But apparently that latter
commit wasn't tested end-to-end enough. It had a lot of tests, but the
tests made assumptions about layering that either weren't true, or
regressed since 1.20. Notably, it didn't remove the (*Filter).pre
bidirectional filter that dropped all "unknown" protocol packets both
leaving and entering, even if there were explicit protocol matches
allowing them in.

Also, don't map all unknown protocols to 0. Keep their IP protocol
number parsed so it's matchable by later layers. Only reject illegal
things.

Fixes #6423
Updates #2162
Updates #2163

Change-Id: I9659b3ece86f4db51d644f9b34df78821758842c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
3 years ago
..
doc.go net/packet: s/ParsedPacket/Parsed/ to avoid package stuttering. 5 years ago
header.go all: fix spelling mistakes 3 years ago
icmp.go wgengine, net/packet, cmd/tailscale: add ICMP echo 4 years ago
icmp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 5 years ago
icmp6.go net/packet: add ICMP6Header, like ICMP4Header 4 years ago
icmp6_test.go all: use various net/netip parse funcs directly 3 years ago
ip4.go all: convert more code to use net/netip directly 3 years ago
ip6.go all: convert more code to use net/netip directly 3 years ago
packet.go net/{packet,tstun},wgengine/filter: fix unknown IP protocol handling 3 years ago
packet_test.go net/{packet,tstun},wgengine/filter: fix unknown IP protocol handling 3 years ago
tsmp.go all: gofmt for Go 1.19 3 years ago
tsmp_test.go all: use various net/netip parse funcs directly 3 years ago
udp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 5 years ago
udp6.go net/packet: don't make IP6Header.marshalPseudo assume UDP 4 years ago