summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2017-07-11 10:28:24 +0000
committerreyk <reyk@openbsd.org>2017-07-11 10:28:24 +0000
commit8415e52b1598f273c11974fc6d2b8ce98710b063 (patch)
tree7fc6c7b98c571a965d8d1cd3c473dd8caaf4e5ad /usr.sbin/dhcpd
parentRemove "listen secure" syntax from smtpd.conf. It's broken since a couple of (diff)
downloadwireguard-openbsd-8415e52b1598f273c11974fc6d2b8ce98710b063.tar.xz
wireguard-openbsd-8415e52b1598f273c11974fc6d2b8ce98710b063.zip
Handle DHCPINFORM from clients behind a DHCP relay.
The dhcpinform() function has assumed that ciaddr matches the packet's IP source address and didn't consider a relay, such as dhcrelay(8) - indicated by giaddr, has forwarded the request. Tested by landry@ OK krw@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r--usr.sbin/dhcpd/dhcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index e55f4d4e40d..238098005d4 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.56 2017/04/24 14:58:36 krw Exp $ */
+/* $OpenBSD: dhcp.c,v 1.57 2017/07/11 10:28:24 reyk Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -527,7 +527,7 @@ dhcpinform(struct packet *packet)
* not all clients are standards compliant.
*/
cip.len = 4;
- if (packet->raw->ciaddr.s_addr) {
+ if (packet->raw->ciaddr.s_addr && !packet->raw->giaddr.s_addr) {
if (memcmp(&packet->raw->ciaddr.s_addr,
packet->client_addr.iabuf, 4) != 0) {
log_info("DHCPINFORM from %s but ciaddr %s is not "