Subject: [PATCH 2.6] ipconfig accepts any DHCPACK

From: Peter Buckingham <[email-masked]>
Date: Tue, 07 Sep 2004 14:46:14 -0700

Hi David,

I was playing around with using ipconfig to initialise a bunch of 
systems and it turns out that the ipconfig code doesn't check to see 
whether the ACK is for it or another system. I've just added a simple 
check to compare the hardware address of the device to the one in the 
packet.

peter

Signed-off-by: Peter Buckingham <[email-masked]>

--- linus-2.6/net/ipv4/ipconfig.c	2004-09-02 14:53:54.000000000 -0700
+++ local_linux/net/ipv4/ipconfig.c	2004-09-02 14:57:49.000000000 -0700
@@ -966,6 +966,12 @@ static int __init ic_bootp_recv(struct s
  				break;

  			case DHCPACK:
+				for (i = 0; (dev->dev_addr[i] == b->hw_addr[i])
+						&& (i < 16); i++);
+				if (i < 16)
+					goto drop_unlock;
+
  				/* Yeah! */
  				break;