summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2013-03-06 22:43:26 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2013-03-06 22:43:26 +0000
commit52a1ae72f0c3a5d7629b54d0fe401388a34b5b74 (patch)
treebbfbeee6594c2c805e41d1f8e6e369ca35ec08f5
parent3a654c506fb040fc94746e6ee9025fef097f87cd (diff)
downloaddnsmasq-2.66test20.tar.gz
Another logic problem in refactor.v2.66test20
-rw-r--r--src/rfc3315.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rfc3315.c b/src/rfc3315.c
index e94ff92..60ff8d7 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -511,6 +511,9 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
if (ignore)
return 0;
+ /* reset USED bits in leases */
+ lease6_reset();
+
for (opt = state.packet_options; opt; opt = opt6_next(opt, state.end))
{
void *ia_option, *ia_end;
@@ -539,8 +542,9 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
config_ok = 0; /* configured address leased elsewhere */
}
- /* reset USED bits in leases */
- lease6_reset();
+ /* reset USED bits in contexts - one address per prefix per IAID */
+ for (c = context; c; c = c->current)
+ c->flags &= ~CONTEXT_USED;
o = build_ia(&state, &t1cntr);
@@ -550,10 +554,6 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
ltmp = lease6_find_by_addr(req_addr, 128, 0);
requested_time = opt6_uint(ia_option, 16, 4);
- /* reset USED bits in contexts - one address per prefix per IAID */
- for (c = context; c; c = c->current)
- c->flags &= ~CONTEXT_USED;
-
if ((c = address6_valid(context, req_addr, tagif)))
{
lease_time = c->lease_time;