From: Ted Lemon Date: Thu, 6 Mar 1997 19:29:39 +0000 (+0000) Subject: Support abandoned keyword in leases X-Git-Tag: DHCP-970328~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4006d804a4d619df524884c161764ab512c7ea60;p=thirdparty%2Fdhcp.git Support abandoned keyword in leases --- diff --git a/server/confpars.c b/server/confpars.c index 6727bda85..b8adf9a2d 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.39 1997/02/22 08:41:01 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.40 1997/03/06 19:29:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1268,6 +1268,11 @@ struct lease *parse_lease_declaration (cfile) lease.flags |= BOOTP_LEASE; break; + case ABANDONED: + seenbit = 256; + lease.flags |= ABANDONED_LEASE; + break; + default: skip_to_semi (cfile); seenbit = 0; diff --git a/server/db.c b/server/db.c index afdaff2ec..ffc196676 100644 --- a/server/db.c +++ b/server/db.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: db.c,v 1.8 1996/09/02 21:16:24 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: db.c,v 1.9 1997/03/06 19:29:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -126,6 +126,13 @@ int write_lease (lease) ++errors; } } + if (lease -> flags & ABANDONED_LEASE) { + errno = 0; + fprintf (db_file, "\n\tabandoned;"); + if (errno) { + ++errors; + } + } errno = 0; fputs ("\n}\n", db_file); if (errno) {