summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-04-08 21:39:34 +0000
committerTed Lemon <source@isc.org>1999-04-08 21:39:34 +0000
commit16d0957092bf3ad8d54f67dce43fa79383869154 (patch)
treef5a757699c6df6669949bf3d86fb3f3ae541969e
parent1f5bc4e612eed83703661dddfa63dcf54b534284 (diff)
downloadisc-dhcp-16d0957092bf3ad8d54f67dce43fa79383869154.tar.gz
Send subnet mask from subnet declaration if no explicit option is provided.
-rw-r--r--server/bootp.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/bootp.c b/server/bootp.c
index d9a9edf9..17317550 100644
--- a/server/bootp.c
+++ b/server/bootp.c
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
-"$Id: bootp.c,v 1.28.2.5 1999/04/06 15:15:00 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bootp.c,v 1.28.2.6 1999/04/08 21:39:34 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -240,6 +240,8 @@ void bootp (packet)
packet -> raw -> options, DHCP_OPTION_LEN);
outgoing.packet_length = BOOTP_MIN_LEN;
} else {
+ struct tree_cache netmask_tree; /* -- RBF */
+
/* Come up with a list of options that we want to send
to this client. Start with the per-subnet options,
and then override those with client-specific
@@ -252,6 +254,18 @@ void bootp (packet)
options [i] = hp -> group -> options [i];
}
+ /* Use the subnet mask from the subnet declaration if no other
+ mask has been provided. */
+ if (!options [DHO_SUBNET_MASK]) {
+ options [DHO_SUBNET_MASK] = &netmask_tree;
+ netmask_tree.flags = TC_TEMPORARY;
+ netmask_tree.value = lease -> subnet -> netmask.iabuf;
+ netmask_tree.len = lease -> subnet -> netmask.len;
+ netmask_tree.buf_size = lease -> subnet -> netmask.len;
+ netmask_tree.timeout = 0xFFFFFFFF;
+ netmask_tree.tree = (struct tree *)0;
+ }
+
/* Pack the options into the buffer. Unlike DHCP, we
can't pack options into the filename and server
name buffers. */