1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Don't throw away bootp reply packets that are shorter than our extended-length

bootp query packet.
PR:		5512
This commit is contained in:
Tor Egge 1998-01-18 18:53:46 +00:00
parent 3bc42d575a
commit 75d515b755
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32610
2 changed files with 6 additions and 2 deletions

View File

@ -559,7 +559,9 @@ await_reply(type, ival, ptr)
bootpreply = (struct bootp_t *)&packet[ETHER_HDR_LEN];
if ((type == AWAIT_BOOTP) &&
(packetlen >= (ETHER_HDR_LEN +
sizeof(struct bootp_t))) &&
sizeof(struct iphdr) +
sizeof(struct udphdr) +
BOOTP_MIN_LEN)) &&
(ntohs(udp->dest) == BOOTP_CLIENT) &&
(bootpreply->bp_op == BOOTP_REPLY)) {
convert_ipaddr(&arptable[ARP_CLIENT].ipaddr,

View File

@ -111,7 +111,9 @@ Author: Martin Renters
#define RFC1048_SWAP_LEN 129 /* T129 */
#define RFC1048_END 255
#define BOOTP_VENDOR_LEN 256
#define BOOTP_VENDOR_LEN 256 /* Extended vendor field */
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
#define TFTP_RRQ 1
#define TFTP_WRQ 2