summaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-03-23 15:43:08 +0100
committerDenys Vlasenko2010-03-23 15:43:08 +0100
commit37a658c4c86fa5ad9fb6f76cba2fca80f4249036 (patch)
tree0cdb35ff2c8baa859eab8a0e5cc5af5108ae06a4 /networking/udhcp/packet.c
parent30ebd7bd7838787bdb7de0b484e37e442ab16ac5 (diff)
downloadbusybox-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.c6
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");