]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- The subnet-mask option is now supplied by default, but at lowest
authorDavid Hankins <dhankins@isc.org>
Tue, 30 May 2006 19:58:14 +0000 (19:58 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 30 May 2006 19:58:14 +0000 (19:58 +0000)
  priority.  This helps a small minority of clients that provide parameter
  request lists, but do not list the subnet-mask option because they were
  designed to interoperate with a server that behaves in this manner.
  [ISC-Bugs #1196]
- The FQDN option is similarly supplied even if it does not appear on the
  parameter request list, but not to the exclusion of options that do
  appear at the parameter request list.  Up until now it had ultimate
  priority over the client's parameter request list.  [ISC-Bugs #1196]

RELNOTES
common/options.c

index d76327537a3ee7d2c7ce33dae110214e7e52f475..4cd3ddfa6a28e09463c687098837884509aa19a1 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -85,6 +85,16 @@ and for prodding me into improving it.
   server-identifiers, now permits address ranges to be specified in CIDR
   notation.  Thanks to a patch from David Boyce.
 
+- The subnet-mask option is now supplied by default, but at lowest
+  priority.  This helps a small minority of clients that provide parameter
+  request lists, but do not list the subnet-mask option because they were
+  designed to interoperate with a server that behaves in this manner.
+
+- The FQDN option is similarly supplied even if it does not appear on the
+  parameter request list, but not to the exclusion of options that do
+  appear at the parameter request list.  Up until now it had ultimate
+  priority over the client's parameter request list.
+
                        Changes since 3.0.4
 
 - A warning that host statements declared within subnet or shared-network
index 28066ed06e1210b7a68ac5c5b621e9754976f221..d69b635ad744fe5874d32f974ab3c7248711aac1 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: options.c,v 1.89 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: options.c,v 1.90 2006/05/30 19:58:14 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #define DHCP_OPTION_DATA
@@ -551,14 +551,15 @@ int cons_options (inpacket, outpacket, lease, client_state,
        if (main_buffer_size > mb_max)
                main_buffer_size = mb_max;
 
-       /* Preload the option priority list with mandatory options. */
+       /* Preload the option priority list with protocol-mandatory options.
+        * This effectively gives these options the highest priority.
+        */
        priority_len = 0;
        priority_list [priority_len++] = DHO_DHCP_MESSAGE_TYPE;
        priority_list [priority_len++] = DHO_DHCP_SERVER_IDENTIFIER;
        priority_list [priority_len++] = DHO_DHCP_LEASE_TIME;
        priority_list [priority_len++] = DHO_DHCP_MESSAGE;
        priority_list [priority_len++] = DHO_DHCP_REQUESTED_ADDRESS;
-       priority_list [priority_len++] = DHO_FQDN;
 
        if (prl && prl -> len > 0) {
                if ((op = lookup_option (&dhcp_universe, cfg_options,
@@ -567,7 +568,7 @@ int cons_options (inpacket, outpacket, lease, client_state,
                                priority_list [priority_len++] =
                                        DHO_SUBNET_SELECTION;
                }
-                           
+
                data_string_truncate (prl, (PRIORITY_COUNT - priority_len));
 
                for (i = 0; i < prl -> len; i++) {
@@ -577,13 +578,32 @@ int cons_options (inpacket, outpacket, lease, client_state,
                                priority_list [priority_len++] =
                                        prl -> data [i];
                }
+
+               /* If the client doesn't request this option explicitly,
+                * to indicate priority, consider it lowest priority.  Fit
+                * in the packet if there is space.
+                */
+               if (priority_len < PRIORITY_COUNT)
+                       priority_list[priority_len++] = DHO_FQDN;
+
+               /* Some DHCP Servers will give the subnet-mask option if
+                * it is not on the parameter request list - so some client
+                * implementations have come to rely on this - so we will
+                * also make sure we supply this, at lowest priority.
+                */
+               if (priority_len < PRIORITY_COUNT)
+                       priority_list[priority_len++] = DHO_SUBNET_MASK;
+
        } else {
                /* First, hardcode some more options that ought to be
-                  sent first... */
-               priority_list [priority_len++] = DHO_SUBNET_MASK;
-               priority_list [priority_len++] = DHO_ROUTERS;
-               priority_list [priority_len++] = DHO_DOMAIN_NAME_SERVERS;
-               priority_list [priority_len++] = DHO_HOST_NAME;
+                * sent first...these are high priority to have in the
+                * packet.
+                */
+               priority_list[priority_len++] = DHO_SUBNET_MASK;
+               priority_list[priority_len++] = DHO_ROUTERS;
+               priority_list[priority_len++] = DHO_DOMAIN_NAME_SERVERS;
+               priority_list[priority_len++] = DHO_HOST_NAME;
+               priority_list[priority_len++] = DHO_FQDN;
 
                /* Append a list of the standard DHCP options from the
                   standard DHCP option space.  Actually, if a site