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>
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user