summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRob Landley2005-05-26 05:25:12 +0000
committerRob Landley2005-05-26 05:25:12 +0000
commit0b1ff5a60630ebe957e3f28a3e17e28ec7b6fbe4 (patch)
tree5fe5db78e39b6cd56658925ae4e036453e3b4304 /networking
parent8b2d02ed34fe9f43c070d553ac5bc9491cb474a2 (diff)
downloadbusybox-0b1ff5a60630ebe957e3f28a3e17e28ec7b6fbe4.zip
busybox-0b1ff5a60630ebe957e3f28a3e17e28ec7b6fbe4.tar.gz
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.
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/dhcpc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 8009bec..d99711c 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");