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
James Tucker 146f51ce76 net/packet: fix filtering of short IPv4 fragments
The fragment offset is an 8 byte offset rather than a byte offset, so
the short packet limit is now in fragment block size in order to compare
with the offset value.

The packet flags are in the first 3 bits of the flags/frags byte, and
so after conversion to a uint16 little endian value they are at the
start, not the end of the value - the mask for extracting "more
fragments" is adjusted to match this byte.

Extremely short fragments less than 80 bytes are dropped, but fragments
over 80 bytes are now accepted.

Fixes #5727

Signed-off-by: James Tucker <james@tailscale.com>
2 years ago
..
doc.go net/packet: s/ParsedPacket/Parsed/ to avoid package stuttering. 4 years ago
header.go net/packet: add ICMP6Header, like ICMP4Header 3 years ago
icmp.go wgengine, net/packet, cmd/tailscale: add ICMP echo 2 years ago
icmp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 4 years ago
icmp6.go net/packet: add ICMP6Header, like ICMP4Header 3 years ago
icmp6_test.go all: use various net/netip parse funcs directly 2 years ago
ip4.go all: convert more code to use net/netip directly 2 years ago
ip6.go all: convert more code to use net/netip directly 2 years ago
packet.go net/packet: fix filtering of short IPv4 fragments 2 years ago
packet_test.go net/packet: fix filtering of short IPv4 fragments 2 years ago
tsmp.go all: gofmt for Go 1.19 2 years ago
tsmp_test.go all: use various net/netip parse funcs directly 2 years ago
udp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 4 years ago
udp6.go net/packet: don't make IP6Header.marshalPseudo assume UDP 3 years ago