aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/containers.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-10 17:17:43 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-10 17:19:01 +0200
commit4e0e99c74d3cd22139d620b9fe21dd3453936e1a (patch)
tree1a026789eef09678dc509d604b51feeb5e00fd29 /src/containers.h
parentwg: warn once on unrecognized items (diff)
downloadwireguard-tools-4e0e99c74d3cd22139d620b9fe21dd3453936e1a.tar.xz
wireguard-tools-4e0e99c74d3cd22139d620b9fe21dd3453936e1a.zip
wg: store tail pointer to make coalescing peers fast
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/containers.h')
-rw-r--r--src/containers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/containers.h b/src/containers.h
index 4c80a77..2d0195d 100644
--- a/src/containers.h
+++ b/src/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)