summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2009-07-24 12:30:05 +0000
committerdlg <dlg@openbsd.org>2009-07-24 12:30:05 +0000
commit7b5045f9ec91b0c7247823576c00d2ca15cd7d7b (patch)
tree7226f5e1182aa2d22af081a27e45f92e215bc4d5 /lib
parentFrom NetBSD rev 1.5 (diff)
downloadwireguard-openbsd-7b5045f9ec91b0c7247823576c00d2ca15cd7d7b.tar.xz
wireguard-openbsd-7b5045f9ec91b0c7247823576c00d2ca15cd7d7b.zip
for every packet we forwarded, we copied the first 68 bytes of it in case
ip_output failed and we had to generate an icmp packet. since ip_output frees the mbuf we give it, we copied the original into a new mbuf. if ip_output succeeded, we threw the copy away. the problem with this is that copying the mbuf is about a third of the cost of ip_forward. this diff copies the data we might need onto the stack, and only builds the mbuf for the icmp error if it actually needs it, ie, if ip_output fails. this gives a noticable improvement in pps for forwarded traffic. ok claudio@ markus@ henning@ tested by markus@ and by me in production for several days at work
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions