mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-28 12:57:42 +00:00
- A bug was fixed where the 'giaddr' may be used to find the client's subnet
rather than its own 'ciaddr'. [ISC-Bugs #16627]
This commit is contained in:
parent
c998be8767
commit
49f61135b3
3
RELNOTES
3
RELNOTES
@ -91,6 +91,9 @@ suggested fixes to <dhcp-users@isc.org>.
|
|||||||
|
|
||||||
- Timer granularity is now 1/100s in the DHCPv6 client.
|
- Timer granularity is now 1/100s in the DHCPv6 client.
|
||||||
|
|
||||||
|
- A bug was fixed where the 'giaddr' may be used to find the client's subnet
|
||||||
|
rather than its own 'ciaddr'.
|
||||||
|
|
||||||
Changes since 4.0.0b3
|
Changes since 4.0.0b3
|
||||||
|
|
||||||
- The reverse dns name for PTR updates on IPv6 addresses has been fixed to
|
- The reverse dns name for PTR updates on IPv6 addresses has been fixed to
|
||||||
|
@ -927,20 +927,25 @@ void dhcpinform (packet, ms_nulltp)
|
|||||||
struct dhcp_packet raw;
|
struct dhcp_packet raw;
|
||||||
struct packet outgoing;
|
struct packet outgoing;
|
||||||
unsigned char dhcpack = DHCPACK;
|
unsigned char dhcpack = DHCPACK;
|
||||||
struct subnet *subnet = (struct subnet *)0;
|
struct subnet *subnet = NULL;
|
||||||
struct iaddr cip, gip;
|
struct iaddr cip, gip;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int nulltp;
|
int nulltp;
|
||||||
struct sockaddr_in to;
|
struct sockaddr_in to;
|
||||||
struct in_addr from;
|
struct in_addr from;
|
||||||
|
isc_boolean_t zeroed_ciaddr;
|
||||||
|
|
||||||
|
memset(zerobuf, 0, sizeof(zerobuf));
|
||||||
|
|
||||||
/* The client should set ciaddr to its IP address, but apparently
|
/* The client should set ciaddr to its IP address, but apparently
|
||||||
it's common for clients not to do this, so we'll use their IP
|
it's common for clients not to do this, so we'll use their IP
|
||||||
source address if they didn't set ciaddr. */
|
source address if they didn't set ciaddr. */
|
||||||
if (!packet -> raw -> ciaddr.s_addr) {
|
if (!packet -> raw -> ciaddr.s_addr) {
|
||||||
|
zeroed_ciaddr = ISC_TRUE;
|
||||||
cip.len = 4;
|
cip.len = 4;
|
||||||
memcpy (cip.iabuf, &packet -> client_addr.iabuf, 4);
|
memcpy (cip.iabuf, &packet -> client_addr.iabuf, 4);
|
||||||
} else {
|
} else {
|
||||||
|
zeroed_ciaddr = ISC_FALSE;
|
||||||
cip.len = 4;
|
cip.len = 4;
|
||||||
memcpy (cip.iabuf, &packet -> raw -> ciaddr, 4);
|
memcpy (cip.iabuf, &packet -> raw -> ciaddr, 4);
|
||||||
}
|
}
|
||||||
@ -966,19 +971,25 @@ void dhcpinform (packet, ms_nulltp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find the subnet that the client is on. */
|
/* Find the subnet that the client is on. */
|
||||||
if (gip.len) {
|
if (zeroed_ciaddr && (gip.len != 0)) {
|
||||||
/* XXX - do subnet selection relay agent suboption here */
|
/* XXX - do subnet selection relay agent suboption here */
|
||||||
find_subnet(&subnet, gip, MDL);
|
find_subnet(&subnet, gip, MDL);
|
||||||
|
|
||||||
|
if (subnet == NULL) {
|
||||||
|
log_info("%s: unknown subnet for relay address %s",
|
||||||
|
msgbuf, piaddr(gip));
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* XXX - do subnet selection (not relay agent) option here */
|
/* XXX - do subnet selection (not relay agent) option here */
|
||||||
find_subnet(&subnet, cip, MDL);
|
find_subnet(&subnet, cip, MDL);
|
||||||
}
|
|
||||||
|
|
||||||
/* Sourceless packets don't make sense here. */
|
if (subnet == NULL) {
|
||||||
if (!subnet) {
|
log_info("%s: unknown subnet for %s address %s",
|
||||||
log_info ("%s: unknown subnet for address %s",
|
msgbuf, zeroed_ciaddr ? "source" : "client",
|
||||||
msgbuf, gip.len ? piaddr(gip) : piaddr(cip));
|
piaddr(cip));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't respond to DHCPINFORM packets if we're not authoritative.
|
/* We don't respond to DHCPINFORM packets if we're not authoritative.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user