From ff4302cf0aa4567641583a0fb3f6d4d2d4b35ff1 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Thu, 8 Oct 2020 11:24:43 +0200 Subject: [PATCH] bug fix in address expiration --- dyndomain | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dyndomain b/dyndomain index 24318e4..0c24ff8 100755 --- a/dyndomain +++ b/dyndomain @@ -159,17 +159,18 @@ def process_zone(zone, stamp, grace_period, sync_zone): update = { 'add': [], 'delete': [] } for prot in zone: for name in zone[prot]: - add = False + active = False for addr in zone[prot][name]: e = zone[prot][name][addr] - if e['first'] == stamp and not sync_zone: + if e['first'] == stamp: update['add'].append([prot, name, addr]) - add = True + if e['last'] == stamp: + active = True for addr in zone[prot][name]: e = zone[prot][name][addr] - if add and e['last'] < stamp: + if active and e['last'] < stamp: update['delete'].append([prot, name, addr]) - elif not add and stamp - e['last'] > grace_period: + elif not active and stamp - e['last'] > grace_period: update['delete'].append([prot, name, addr]) elif sync_zone: update['add'].append([prot, name, addr])