]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
No lease-time in DHCPINFORM replies.
authorSimon Kelley <simon@thekelleys.org.uk>
Mon, 5 Nov 2012 16:50:30 +0000 (16:50 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 5 Nov 2012 16:50:30 +0000 (16:50 +0000)
CHANGELOG
src/rfc2131.c

index 2de505e1b4883229ea4687908c70459ed0cca797..42f7f736a76e6199b853ac29cdcc96d6491ee861 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -45,7 +45,11 @@ version 2.64
            subnet, --dhcp-range=::,static Useful for Stateless 
            DHCPv6. Thanks to Vladislav Grishenko for the patch.
 
+           Don't include lease-time in DHCPACK replies to DHCPINFORM
+           queries, since RFC-2131 says we shouldn't. Thanks to
+           Wouter Ibens for pointing this out.  
            
+
 version 2.63
             Do duplicate dhcp-host address check in --test mode.
 
index 250b1abc2f87ee6d4df7e5a3e47836527ece0990..9816e29b08e04f7f224c5866497b91fd827b09c9 100644 (file)
@@ -1387,6 +1387,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
       
       if (lease)
        {
+         lease_set_interface(lease, int_index, now);
          if (override.s_addr != 0)
            lease->override = override;
          else
@@ -1397,16 +1398,6 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
       option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK);
       option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallback).s_addr));
       
-      if (lease)
-       {
-         if (lease->expires == 0)
-           time = 0xffffffff;
-         else
-           time = (unsigned int)difftime(lease->expires, now);
-         option_put(mess, end, OPTION_LEASE_TIME, 4, time);
-         lease_set_interface(lease, int_index, now);
-       }
-
       do_options(context, mess, end, req_options, hostname, get_domain(mess->ciaddr),
                 netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid, vendor_class_len, now);