-/* $OpenBSD: clparse.c,v 1.158 2017/12/17 14:24:04 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.159 2017/12/18 14:17:58 krw Exp $ */
/* Parser for dhclient config and lease files. */
}
if (token == '}') {
token = next_token(NULL, cfile);
- if (lease->interface != NULL &&
- strcmp(name, lease->interface) == 0)
- *lp = lease;
- else {
- *lp = NULL;
- free_client_lease(lease);
- }
+ *lp = lease;
return 1;
}
parse_lease_declaration(cfile, lease, name);
return;
break;
case TOK_INTERFACE:
- if (parse_string(cfile, NULL, &val) == 0)
- return;
- free(lease->interface);
- lease->interface = val;
- break;
+ /* 'interface' is just a comment. */
+ skip_to_semi(cfile);
+ return;
case TOK_NEXT_SERVER:
if (parse_ip_addr(cfile, &lease->next_server) == 0)
return;
-/* $OpenBSD: dhclient.c,v 1.541 2017/12/16 20:47:53 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.542 2017/12/18 14:17:58 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
if (lease == NULL)
return;
- free(lease->interface);
free(lease->server_name);
free(lease->filename);
for (i = 0; i < DHO_COUNT; i++)
strlcat(string, " {\n", sizeof(string));
strlcat(string, BOOTP_LEASE(lease) ? " bootp;\n" : "", sizeof(string));
- buf = pretty_print_string(ifname, strlen(ifname), 1);
- if (buf == NULL)
- return NULL;
- append_statement(string, sizeof(string), " interface ", buf);
-
append_statement(string, sizeof(string), " fixed-address ",
inet_ntoa(lease->address));
append_statement(string, sizeof(string), " next-server ",
-.\" $OpenBSD: dhclient.leases.5,v 1.13 2017/11/09 17:30:22 jmc Exp $
+.\" $OpenBSD: dhclient.leases.5,v 1.14 2017/12/18 14:17:58 krw Exp $
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" All rights reserved.
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
.\"
-.Dd $Mdocdate: November 9 2017 $
+.Dd $Mdocdate: December 18 2017 $
.Dt DHCLIENT.LEASES 5
.Os
.Sh NAME
This is required for all lease statements.
The IPv4 address is specified as a dotted quad (e.g. 12.34.56.78).
.Pp
-.It Ic interface Qq Ar string
-The interface on which the lease is valid.
-Every lease must contain an
-.Ic interface
-declaration.
-.Pp
.It Ic next-server Ar ip-address
The IPv4 address of the boot server.
The IPv4 address is specified as a dotted quad (e.g. 12.34.56.78).
-/* $OpenBSD: dhcpd.h,v 1.242 2017/12/16 20:47:53 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.243 2017/12/18 14:17:58 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
struct client_lease {
TAILQ_ENTRY(client_lease) next;
- char *interface;
time_t epoch;
struct in_addr address;
struct in_addr next_server;