summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/options.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2007-10-21 13:12:31 +0000
committerkrw <krw@openbsd.org>2007-10-21 13:12:31 +0000
commit2b30e5f2c4750320e97ade218271eb8654b8912c (patch)
tree0f382292b54d6fe5a60ea84eab4a00d088745057 /usr.sbin/dhcpd/options.c
parentbring device back from power save mode if needed. fixes a problem reported (diff)
downloadwireguard-openbsd-2b30e5f2c4750320e97ade218271eb8654b8912c.tar.xz
wireguard-openbsd-2b30e5f2c4750320e97ade218271eb8654b8912c.zip
Take even more care to ensure the max message size is at
least as large as the minimum IP MTU. ok canacar@ henning@ millert@
Diffstat (limited to 'usr.sbin/dhcpd/options.c')
-rw-r--r--usr.sbin/dhcpd/options.c10
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;