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>
2022-09-23 10:43:28 -07:00
..
doc.go net/packet: s/ParsedPacket/Parsed/ to avoid package stuttering. 2020-11-09 23:52:54 -08:00
header.go net/packet: add ICMP6Header, like ICMP4Header 2021-12-09 09:30:10 -08:00
icmp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 2021-03-20 21:45:47 -07:00
icmp6_test.go all: use various net/netip parse funcs directly 2022-07-25 21:12:28 -07:00
icmp6.go net/packet: add ICMP6Header, like ICMP4Header 2021-12-09 09:30:10 -08:00
icmp.go wgengine, net/packet, cmd/tailscale: add ICMP echo 2022-05-03 13:03:45 -07:00
ip4.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
ip6.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
packet_test.go net/packet: fix filtering of short IPv4 fragments 2022-09-23 10:43:28 -07:00
packet.go net/packet: fix filtering of short IPv4 fragments 2022-09-23 10:43:28 -07:00
tsmp_test.go all: use various net/netip parse funcs directly 2022-07-25 21:12:28 -07:00
tsmp.go all: gofmt for Go 1.19 2022-08-02 10:08:05 -07:00
udp4.go net/packet, wgengine{,/filter}: remove net/packet IPProto forwarding consts 2021-03-20 21:45:47 -07:00
udp6.go net/packet: don't make IP6Header.marshalPseudo assume UDP 2021-12-08 21:15:46 -08:00