summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-03-11 15:43:39 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-03-11 15:43:39 +0000
commit7519ec58c9795bc62e87fd22b065ca1d490efc67 (patch)
tree21ed445c35496c3fea63f9eb6643eb6b69487f35 /usr.sbin/dhcpd
parenteed57b915bdd080ae85e0d53a4923c6de4af89c5 (diff)
RFC 2131 says don't ACK any REQUEST messages that contain a
server-identifier option that specifies a different dhcp server. So don't. Pointed put and fix tested by Andy via bugs@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r--usr.sbin/dhcpd/dhcp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index b9c78814c50..b265c4a2e4a 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.33 2013/02/14 22:06:13 krw Exp $ */
+/* $OpenBSD: dhcp.c,v 1.34 2013/03/11 15:43:38 krw Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -321,6 +321,15 @@ dhcprequest(struct packet *packet)
return;
}
+ /*
+ * Do not ACK a REQUEST intended for another server.
+ */
+ if (packet->options[DHO_DHCP_SERVER_IDENTIFIER].len == 4) {
+ if (memcmp(packet->options[DHO_DHCP_SERVER_IDENTIFIER].data,
+ &packet->interface->primary_address, 4))
+ return;
+ }
+
/*
* If we own the lease that the client is asking for,
* and it's already been assigned to the client, ack it.