diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-10 17:17:43 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-10 17:19:01 +0200 |
commit | a0e814f4d60494045433782a8ce0f24b8e98e557 (patch) | |
tree | 85e58d9bfe60540af87410816546fd9727430520 /src/tools/containers.h | |
parent | tools: warn once on unrecognized items (diff) | |
download | wireguard-monolithic-historical-a0e814f4d60494045433782a8ce0f24b8e98e557.tar.xz wireguard-monolithic-historical-a0e814f4d60494045433782a8ce0f24b8e98e557.zip |
tools: store tail pointer to make coalescing peers fast
Diffstat (limited to 'src/tools/containers.h')
-rw-r--r-- | src/tools/containers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/containers.h b/src/tools/containers.h index 4c80a77..2d0195d 100644 --- a/src/tools/containers.h +++ b/src/tools/containers.h @@ -46,7 +46,7 @@ struct wgpeer { uint64_t rx_bytes, tx_bytes; uint16_t persistent_keepalive_interval; - struct wgallowedip *first_allowedip; + struct wgallowedip *first_allowedip, *last_allowedip; struct wgpeer *next_peer; }; @@ -73,7 +73,7 @@ struct wgdevice { uint32_t fwmark; uint16_t listen_port; - struct wgpeer *first_peer; + struct wgpeer *first_peer, *last_peer; }; #define for_each_wgpeer(__dev, __peer) for ((__peer) = (__dev)->first_peer; (__peer); (__peer) = (__peer)->next_peer) |