diff options
| author | Ian Dowse <iedowse@FreeBSD.org> | 2001-10-14 21:20:12 +0000 |
|---|---|---|
| committer | Ian Dowse <iedowse@FreeBSD.org> | 2001-10-14 21:20:12 +0000 |
| commit | 87417eef4f4fa58ce87aaf11781a4c8cd445de91 (patch) | |
| tree | 16c0c8c4fbd755f5e504e860fc77d0c6fa07ea63 /libexec | |
| parent | dc594c47807aa7067fe1e09d35170e454d094d78 (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/bootpd/bootp.h | 2 | ||||
| -rw-r--r-- | libexec/bootpd/bootpd.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libexec/bootpd/bootp.h b/libexec/bootpd/bootp.h index 479dd3b9e055..c3a3909287ba 100644 --- a/libexec/bootpd/bootp.h +++ b/libexec/bootpd/bootp.h @@ -38,6 +38,8 @@ SOFTWARE. #define BP_FILE_LEN 128 #define BP_VEND_LEN 64 #define BP_MINPKTSZ 300 /* to check sizeof(struct bootp) */ +/* Overhead to fit a bootp message into an Ethernet packet. */ +#define BP_MSG_OVERHEAD (14 + 20 + 8) /* Ethernet + IP + UDP headers */ struct bootp { unsigned char bp_op; /* packet opcode type */ diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c index aac6263cec5b..54de708f6309 100644 --- a/libexec/bootpd/bootpd.c +++ b/libexec/bootpd/bootpd.c @@ -1292,10 +1292,10 @@ dovend_rfc1048(bp, hp, bootsize) p += len; } - if (msgsz > sizeof(*bp)) { + if (msgsz > sizeof(*bp) + BP_MSG_OVERHEAD) { if (debug > 1) report(LOG_INFO, "request has DHCP msglen=%d", msgsz); - pktlen = msgsz; + pktlen = msgsz - BP_MSG_OVERHEAD; } } } |
