summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2017-07-11 10:28:25 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2017-07-11 10:28:25 +0000
commitc875b067af8c2974deb49835eb4ac0db8f4ccc4d (patch)
tree1699c567a534e1860cd51e6383b5fad17a99f964 /usr.sbin/dhcpd
parent9acd92d1f5a125fceffd8c538b95d2053adbccad (diff)
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 "