]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fixed DHCPv6 rapid commit support
authorFrancis Dupont <fdupont@isc.org>
Thu, 24 Jan 2008 10:55:34 +0000 (10:55 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 24 Jan 2008 10:55:34 +0000 (10:55 +0000)
server/dhcpv6.c

index e21b1205df6e61d3f590bbaa3c0142af8e69b634..a4504c0e6fc1a81b9e4f6fba772912dd2759ae15 100644 (file)
@@ -821,20 +821,24 @@ start_reply(struct packet *packet,
                        oc = lookup_option(&dhcpv6_universe,
                                           packet->options, D6O_RAPID_COMMIT);
                        if (oc != NULL) {
-                               if (!save_option_buffer(&dhcpv6_universe,
-                                                       *opt_state, NULL,
-                                                       (unsigned char *)"", 0,
-                                                       D6O_RAPID_COMMIT, 0)) {
-                                       log_error("start_reply: error saving "
-                                                 "RAPID_COMMIT option.");
-                                       return 0;
-                               }
-
+                               /* Rapid-commit in action. */
                                reply->msg_type = DHCPV6_REPLY;
+                       } else {
+                               /* Don't want a rapid-commit in advertise. */
+                               delete_option(&dhcpv6_universe,
+                                             *opt_state, D6O_RAPID_COMMIT);
                        }
                }
-       } else
+       } else {
                reply->msg_type = DHCPV6_REPLY;
+               /* Delete the rapid-commit from the sent options. */
+               oc = lookup_option(&dhcpv6_universe,
+                                  *opt_state, D6O_RAPID_COMMIT);
+               if (oc != NULL) {
+                       delete_option(&dhcpv6_universe,
+                                     *opt_state, D6O_RAPID_COMMIT);
+               }
+       }
 
        /* 
         * Use the client's transaction identifier for the reply.