From: Ted Lemon Date: Thu, 1 Jul 1999 19:58:12 +0000 (+0000) Subject: Name server update hooks. X-Git-Tag: V3-BETA-1-PATCH-0~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45378e45e11f06633e09185241fd00eb3b40eeb4;p=thirdparty%2Fdhcp.git Name server update hooks. --- diff --git a/server/dhcp.c b/server/dhcp.c index 0ab231521..cc9f67b70 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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