IPv6 forward copies small packet content on the stack.
authorbluhm <bluhm@openbsd.org>
Tue, 9 Jul 2024 09:33:13 +0000 (09:33 +0000)
committerbluhm <bluhm@openbsd.org>
Tue, 9 Jul 2024 09:33:13 +0000 (09:33 +0000)
commitdd7e0821af102a78b65c074d8eef53ce2bb778a0
tree718819a7631e27d3b6bef02ad209b8a02e81c49e
parentba66f5646b2078267ada7f93fdb09284b0ca3a3d
IPv6 forward copies small packet content on the stack.

Unfortunately RFC 4443 demands that the ICMP6 error packet containing
the orignal packet is up to 1280 bytes long.  That means for every
forwarded packet forward() creates a mbuf copy, just in case delivery
fails.

For small packets we can copy the content on the stack like IPv4
forward does.  This saves us some mbuf allocations if the content
is shorter than the mbuf data size.

OK mvs@
sys/netinet6/ip6_forward.c