From 8415e52b1598f273c11974fc6d2b8ce98710b063 Mon Sep 17 00:00:00 2001 From: reyk Date: Tue, 11 Jul 2017 10:28:24 +0000 Subject: [PATCH] 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@ --- usr.sbin/dhcpd/dhcp.c | 4 ++-- 1 file 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 " -- 2.20.1