]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Name server update hooks.
authorTed Lemon <source@isc.org>
Thu, 1 Jul 1999 19:58:12 +0000 (19:58 +0000)
committerTed Lemon <source@isc.org>
Thu, 1 Jul 1999 19:58:12 +0000 (19:58 +0000)
server/dhcp.c

index 0ab231521f3f8e0d5a483e0e789f96be1f2bb0c4..cc9f67b70535fe03c01d74281accbdfbf4012a61 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.93 1999/06/22 13:28:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.94 1999/07/01 19:58:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -292,6 +292,9 @@ void dhcprelease (packet)
 
        /* If we found a lease, release it. */
        if (lease) {
+#if defined (NSUPDATE)
+               nsupdate (lease, lease -> state, packet, DELETE);
+#endif
                release_lease (lease);
        }
 }
@@ -1157,6 +1160,18 @@ void ack_lease (packet, lease, offer, when, msg)
        lt.subnet = lease -> subnet;
        lt.billing_class = lease -> billing_class;
 
+       /* Do the DDNS update.  It needs to be done here so that the lease
+          structure values for the forward and reverse names are in place for
+          supercede()->write_lease() to be able to write into the dhcpd.leases
+          file.  We have to pass the "state" structure here as it is not yet
+          hanging off the lease. */
+       /* why not update for static leases too? */
+       /* Because static leases aren't currently recorded? */
+#if defined (NSUPDATE)
+       if (!(lease -> flags & STATIC_LEASE) && offer == DHCPACK)
+               nsupdate (lease, state, packet, ADD);
+#endif
+
        /* Don't call supersede_lease on a mocked-up lease. */
        if (lease -> flags & STATIC_LEASE) {
                /* Copy the hardware address into the static lease