aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2019-12-12 14:01:36 +0100
committerLinus Nordberg <linus@nordberg.se>2019-12-12 14:01:36 +0100
commit20428bc5d6923d1531bf0b2409fe3f9a5538ecd4 (patch)
tree2e21d63ba8084f073a42ca91bda80597d448d1c6
parentUse siphash for hashtables (diff)
downloadwg-dynamic-master.tar.xz
wg-dynamic-master.zip
Do remove expired leases from allowedipsHEADmasterln/devel
-rw-r--r--lease.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lease.c b/lease.c
index fd51817..de16cab 100644
--- a/lease.c
+++ b/lease.c
@@ -331,11 +331,15 @@ int leases_refresh()
BUG_ON(!lease);
time_t expires = lease->start_mono + lease->leasetime;
if (cur_time >= expires) {
- if (lease->ipv4.s_addr)
+ if (lease->ipv4.s_addr) {
ipp_del_v4(&ipns, &lease->ipv4, 32);
+ memset(&lease->ipv4, 0, sizeof(lease->ipv4));
+ }
- if (!IN6_IS_ADDR_UNSPECIFIED(&lease->ipv6))
+ if (!IN6_IS_ADDR_UNSPECIFIED(&lease->ipv6)) {
ipp_del_v6(&ipns, &lease->ipv6, 128);
+ memset(&lease->ipv6, 0, sizeof(lease->ipv6));
+ }
memcpy(updates[i].peer_pubkey, kh_key(leases_ht, k),
sizeof(wg_key));