diff options
-rw-r--r-- | src/lease.c | 19 | ||||
-rw-r--r-- | src/rfc3315.c | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/lease.c b/src/lease.c index 5c33df7..64f6647 100644 --- a/src/lease.c +++ b/src/lease.c @@ -687,16 +687,21 @@ struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_typ struct dhcp_lease *lease6_find_by_addr(struct in6_addr *net, int prefix, u64 addr) { struct dhcp_lease *lease; - + + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): +"); + for (lease = leases; lease; lease = lease->next) { if (!(lease->flags & (LEASE_TA | LEASE_NA))) continue; if (is_same_net6(&lease->addr6, net, prefix) && - (prefix == 128 || addr6part(&lease->addr6) == addr)) + (prefix == 128 || addr6part(&lease->addr6) == addr)) { + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): -"); return lease; + } } + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): -"); return NULL; } @@ -750,6 +755,9 @@ struct in_addr lease_find_max_addr(struct dhcp_context *context) static struct dhcp_lease *lease_allocate(void) { struct dhcp_lease *lease; + + my_syslog(MS_DHCP | LOG_INFO, "lease_allocate(): +"); + if (!leases_left || !(lease = whine_malloc(sizeof(struct dhcp_lease)))) return NULL; @@ -766,6 +774,8 @@ static struct dhcp_lease *lease_allocate(void) file_dirty = 1; leases_left--; + my_syslog(MS_DHCP | LOG_INFO, "lease_allocate(): -"); + return lease; } @@ -781,15 +791,18 @@ struct dhcp_lease *lease4_allocate(struct in_addr addr) #ifdef HAVE_DHCP6 struct dhcp_lease *lease6_allocate(struct in6_addr *addrp, int lease_type) { + my_syslog(MS_DHCP | LOG_INFO, "lease6_allocate(): +"); + struct dhcp_lease *lease = lease_allocate(); if (lease) { - lease->addr6 = *addrp; + memcpy(&lease->addr6, addrp, sizeof(struct in6_addr)); lease->flags |= lease_type; lease->iaid = 0; } + my_syslog(MS_DHCP | LOG_INFO, "lease6_allocate(): -"); return lease; } #endif diff --git a/src/rfc3315.c b/src/rfc3315.c index 3a2ed75..d416a90 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -1814,6 +1814,7 @@ static void update_leases(struct state *state, struct dhcp_context *context, str #ifdef HAVE_SCRIPT struct dhcp_netid *tagif = run_tag_if(state->tags); #endif + my_syslog(MS_DHCP | LOG_INFO, "update_leases(): +"); (void)context; @@ -1902,6 +1903,7 @@ static void update_leases(struct state *state, struct dhcp_context *context, str #endif } + my_syslog(MS_DHCP | LOG_INFO, "update_leases(): -"); } |