diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-21 13:12:32 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-21 13:12:32 +0000 |
commit | 9889a26c9cbc0f9b17010a0a9423f5725f5f5faf (patch) | |
tree | 221faaa8a5b10110f17c9d99abe0046195323524 | |
parent | c68f32e747f94f99acd731da4ce88128f3a3f708 (diff) |
Take even more care to ensure the max message size is at
least as large as the minimum IP MTU.
ok canacar@ henning@ millert@
-rw-r--r-- | usr.sbin/dhcpd/options.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/dhcpd/options.c b/usr.sbin/dhcpd/options.c index 3764ffd1223..0a8ac0bc160 100644 --- a/usr.sbin/dhcpd/options.c +++ b/usr.sbin/dhcpd/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.16 2007/10/21 01:08:17 krw Exp $ */ +/* $OpenBSD: options.c,v 1.17 2007/10/21 13:12:31 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -226,13 +226,13 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, sizeof(u_int16_t))) { mms = getUShort( inpacket->options[DHO_DHCP_MAX_MESSAGE_SIZE].data); - if (mms < 576) - mms = 576; /* mms must be >= minimum IP MTU */ } - if (mms) + if (mms) { + if (mms < 576) + mms = 576; /* mms must be >= minimum IP MTU */ main_buffer_size = mms - DHCP_FIXED_LEN; - else if (bootpp) + } else if (bootpp) main_buffer_size = 64; else main_buffer_size = 576 - DHCP_FIXED_LEN; |