DHCPv6 IAID should be of unsigned type. It is derived from strtoul() in lease.c:read_leases() and already now interpreted as unsigned in helper.c:276 and outpacket.c:put_opt6_long(). RFC3315 (section 22.4) shows that the IAID is 4 bytes long so we do not need to go up to unsigned long.

Signed-off-by: Dominik DL6ER <dl6er@dl6er.de>
This commit is contained in:
Dominik DL6ER
2019-10-20 18:51:52 +02:00
committed by Simon Kelley
parent 157d8cfd6a
commit 456a319775
5 changed files with 17 additions and 12 deletions

View File

@@ -635,7 +635,8 @@ struct dhcp_lease *lease_find_by_addr(struct in_addr addr)
#ifdef HAVE_DHCP6
/* find address for {CLID, IAID, address} */
struct dhcp_lease *lease6_find(unsigned char *clid, int clid_len,
int lease_type, int iaid, struct in6_addr *addr)
int lease_type, unsigned int iaid,
struct in6_addr *addr)
{
struct dhcp_lease *lease;
@@ -667,7 +668,9 @@ void lease6_reset(void)
}
/* enumerate all leases belonging to {CLID, IAID} */
struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_type, unsigned char *clid, int clid_len, int iaid)
struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_type,
unsigned char *clid, int clid_len,
unsigned int iaid)
{
struct dhcp_lease *lease;
@@ -849,7 +852,7 @@ void lease_set_expires(struct dhcp_lease *lease, unsigned int len, time_t now)
}
#ifdef HAVE_DHCP6
void lease_set_iaid(struct dhcp_lease *lease, int iaid)
void lease_set_iaid(struct dhcp_lease *lease, unsigned int iaid)
{
if (lease->iaid != iaid)
{