]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Remove the pre-errata code for handling no addresses available
authorShawn Routhier <sar@isc.org>
Tue, 29 Apr 2014 16:59:21 +0000 (09:59 -0700)
committerShawn Routhier <sar@isc.org>
Tue, 29 Apr 2014 16:59:21 +0000 (09:59 -0700)
RELNOTES
includes/site.h
server/dhcpv6.c

index d4f99542dc68d11f41a9e5c7a0a1e8251f622c81..4123485339b648de07e8c0f9b8119d60d076a13d 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -90,6 +90,11 @@ by Eric Young (eay@cryptsoft.com).
   option in the list.
   [ISC-Bugs #24580]
 
+- Remove the code that allows a server to follow RFC3315 instead of
+  the subsequent errata from August 2010 when determining which IAs
+  to include if no addresses will be assigned.
+
+
                        Changes since 4.3.0rc1
 
 - None
index 72953626cea06347d16ae78cf8602bcac8b2ca87..34aba0c07adeaa89aeff6db6626b63ca11b83b60 100644 (file)
 
 #define ACCEPT_LIST_IN_DOMAIN_NAME
 
-/* In RFC3315 section 17.2.2 stated that if the server was not going
-   to be able to assign any addresses to any IAs in a subsequent Request
-   from a client that the server should not include any IAs.  This
-   requirement was removed in an errata from August 2010.  Define the
-   following if you want the pre-errata version.  
-   You should only enable this option if you have clients that
-   require the original functionality. */
-
-/* #define RFC3315_PRE_ERRATA_2010_08 */
-
 /* In previous versions of the code when the server generates a NAK
    it doesn't attempt to determine if the configuration included a
    server ID for that client.  Defining this option causes the server
index 45ea753cc1a679e91f28179b3c8343f494c63826..d1a425530629ab30d794482f441556bc805c63f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2013 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2006-2014 by Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -683,12 +683,6 @@ static const int required_opts[] = {
        D6O_PREFERENCE,
        0
 };
-static const int required_opts_NAA[] = {
-       D6O_CLIENTID,
-       D6O_SERVERID,
-       D6O_STATUS_CODE,
-       0
-};
 static const int required_opts_solicit[] = {
        D6O_CLIENTID,
        D6O_SERVERID,
@@ -1312,9 +1306,6 @@ lease_to_client(struct data_string *reply_ret,
        static struct reply_state reply;
        struct option_cache *oc;
        struct data_string packet_oro;
-#if defined (RFC3315_PRE_ERRATA_2010_08)
-       isc_boolean_t no_resources_avail = ISC_FALSE;
-#endif
        int i;
 
        memset(&packet_oro, 0, sizeof(packet_oro));
@@ -1397,15 +1388,6 @@ lease_to_client(struct data_string *reply_ret,
                if ((status != ISC_R_SUCCESS) &&
                    (status != ISC_R_NORESOURCES))
                        goto exit;
-
-#if defined (RFC3315_PRE_ERRATA_2010_08)
-               /*
-                * If any address cannot be given to any IA, then set the
-                * NoAddrsAvail status code.
-                */
-               if (reply.client_resources == 0)
-                       no_resources_avail = ISC_TRUE;
-#endif
        }
        oc = lookup_option(&dhcpv6_universe, packet->options, D6O_IA_TA);
        for (; oc != NULL ; oc = oc->next) {
@@ -1424,15 +1406,6 @@ lease_to_client(struct data_string *reply_ret,
                if ((status != ISC_R_SUCCESS) &&
                    (status != ISC_R_NORESOURCES))
                        goto exit;
-
-#if defined (RFC3315_PRE_ERRATA_2010_08)
-               /*
-                * If any address cannot be given to any IA, then set the
-                * NoAddrsAvail status code.
-                */
-               if (reply.client_resources == 0)
-                       no_resources_avail = ISC_TRUE;
-#endif
        }
 
        /* Same for IA_PD's. */
@@ -1508,6 +1481,9 @@ lease_to_client(struct data_string *reply_ret,
         * the user, a Server Identifier option with the server's DUID,
         * and a Client Identifier option with the client's DUID.
         *
+        * This has been updated by an errata such that the server
+        * can always send an IA.
+        *
         * Section 18.2.1 (Request):
         *
         * If the server cannot assign any addresses to an IA in the
@@ -1522,51 +1498,7 @@ lease_to_client(struct data_string *reply_ret,
         * the server.
         * Sends a Renew/Rebind if the IA is not in the Reply message.
         */
-#if defined (RFC3315_PRE_ERRATA_2010_08)
-       if (no_resources_avail && (reply.ia_count != 0) &&
-           (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT))
-       {
-               /* Set the NoAddrsAvail status code. */
-               if (!set_status_code(STATUS_NoAddrsAvail,
-                                    "No addresses available for this "
-                                    "interface.", reply.opt_state)) {
-                       log_error("lease_to_client: Unable to set "
-                                 "NoAddrsAvail status code.");
-                       goto exit;
-               }
-
-               /* Rewind the cursor to the start. */
-               reply.cursor = REPLY_OPTIONS_INDEX;
 
-               /*
-                * Produce an advertise that includes only:
-                *
-                * Status code.
-                * Server DUID.
-                * Client DUID.
-                */
-               reply.buf.reply.msg_type = DHCPV6_ADVERTISE;
-               reply.cursor += store_options6((char *)reply.buf.data +
-                                                       reply.cursor,
-                                              sizeof(reply.buf) -
-                                                       reply.cursor,
-                                              reply.opt_state, reply.packet,
-                                              required_opts_NAA,
-                                              NULL);
-       } else {
-               /*
-                * Having stored the client's IA's, store any options that
-                * will fit in the remaining space.
-                */
-               reply.cursor += store_options6((char *)reply.buf.data +
-                                                       reply.cursor,
-                                              sizeof(reply.buf) -
-                                                       reply.cursor,
-                                              reply.opt_state, reply.packet,
-                                              required_opts_solicit,
-                                              &packet_oro);
-       }
-#else /* defined (RFC3315_PRE_ERRATA_2010_08) */
        /*
         * Having stored the client's IA's, store any options that
         * will fit in the remaining space.
@@ -1576,7 +1508,6 @@ lease_to_client(struct data_string *reply_ret,
                                       reply.opt_state, reply.packet,
                                       required_opts_solicit,
                                       &packet_oro);
-#endif /* defined (RFC3315_PRE_ERRATA_2010_08) */
 
        /* Return our reply to the caller. */
        reply_ret->len = reply.cursor;