diff options
author | Denys Vlasenko | 2010-03-23 15:43:08 +0100 |
---|---|---|
committer | Denys Vlasenko | 2010-03-23 15:43:08 +0100 |
commit | 37a658c4c86fa5ad9fb6f76cba2fca80f4249036 (patch) | |
tree | 0cdb35ff2c8baa859eab8a0e5cc5af5108ae06a4 /networking/udhcp/packet.c | |
parent | 30ebd7bd7838787bdb7de0b484e37e442ab16ac5 (diff) | |
download | busybox-37a658c4c86fa5ad9fb6f76cba2fca80f4249036.zip busybox-37a658c4c86fa5ad9fb6f76cba2fca80f4249036.tar.gz |
udhcp: handle errors in read_staticlease
also gets rid of ether-aton's static buffer in ether-wake:
text data bss dec hexfilename
838664 441 7572 846677 ceb55busybox_old
838650 441 7564 846655 ceb3fbusybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r-- | networking/udhcp/packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index 03d5e1f..5b113bc 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c @@ -113,8 +113,8 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet *packet, int fd) }; int i; for (i = 0; broken_vendors[i][0]; i++) { - if (vendor[OPT_LEN - 2] == (uint8_t)strlen(broken_vendors[i]) - && !strncmp((char*)vendor, broken_vendors[i], vendor[OPT_LEN - 2]) + if (vendor[OPT_LEN - OPT_DATA] == (uint8_t)strlen(broken_vendors[i]) + && strncmp((char*)vendor, broken_vendors[i], vendor[OPT_LEN - OPT_DATA]) == 0 ) { log1("Broken client (%s), forcing broadcast replies", broken_vendors[i]); @@ -122,7 +122,7 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet *packet, int fd) } } #else - if (vendor[OPT_LEN - 2] == (uint8_t)(sizeof("MSFT 98")-1) + if (vendor[OPT_LEN - OPT_DATA] == (uint8_t)(sizeof("MSFT 98")-1) && memcmp(vendor, "MSFT 98", sizeof("MSFT 98")-1) == 0 ) { log1("Broken client (%s), forcing broadcast replies", "MSFT 98"); |