summaryrefslogtreecommitdiffstatshomepage
path: root/src/dkms.conf
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-04-09 04:56:00 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-04-09 04:56:00 +0200
commit65a56f7b0978b3e8addf337463baf074254f8581 (patch)
tree59a2993d0669a51b512c4c5d8d3af48b2f15e692 /src/dkms.conf
parentdebug: cleanups (diff)
downloadwireguard-monolithic-historical-65a56f7b0978b3e8addf337463baf074254f8581.tar.xz
wireguard-monolithic-historical-65a56f7b0978b3e8addf337463baf074254f8581.zip
data: alloca is actually as dangerous as they say
It turns out that calling alloca from an inline function means that the memory isn't ever deallocated until the caller function exits, which means we were using tons of stack space for every iteration of the call. So, we hard code the sg array. While 128 seems like a reasonable number, we actually wind up using "MAX_SKB_FRAGS * 2 + 1". An skb has its data segment, so that's 1. Then it has its frags, which are MAX_SKB_FRAGS at max. Then it has its frag list, which, so far as I can tell, are potentially unbounded. So we just hope it's no more than MAX_SKB_FRAGS, and so we plan for at most two of those.
Diffstat (limited to 'src/dkms.conf')
0 files changed, 0 insertions, 0 deletions