From e5b6b0501db821e681027fa6ba63ec2647243e08 Mon Sep 17 00:00:00 2001
From: landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Thu, 26 May 2005 05:25:12 +0000
Subject: Tobias Krawutschke found a bug where the DHCP client would accept
 packets with the wrong ARP address, meaning we could easily get somebody
 else's IP. That is a bad thing, and this is the minimal two-line fix.

git-svn-id: svn://busybox.net/trunk/busybox@10407 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 networking/udhcp/dhcpc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 8009bec04..d99711c43 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -439,6 +439,9 @@ int main(int argc, char *argv[])
 					(unsigned long) packet.xid, xid);
 				continue;
 			}
+			/* Ignore packets that aren't for us */
+			if (memcmp(client_config.arp,packet.chaddr,6))
+				continue;
 
 			if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) {
 				DEBUG(LOG_ERR, "couldnt get option from packet -- ignoring");
-- 
cgit v1.2.3-55-g6feb