diff options
author | 2013-03-11 15:43:38 +0000 | |
---|---|---|
committer | 2013-03-11 15:43:38 +0000 | |
commit | 09a99a611ad9937e28beedb177e68a0f2f55d61e (patch) | |
tree | 7ffab411d158bf9bcfab847fc0a9256b9defd086 | |
parent | fix REGRESS -> TEST (diff) | |
download | wireguard-openbsd-09a99a611ad9937e28beedb177e68a0f2f55d61e.tar.xz wireguard-openbsd-09a99a611ad9937e28beedb177e68a0f2f55d61e.zip |
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@
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 11 |
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. |