-/* $OpenBSD: clparse.c,v 1.154 2017/12/09 15:48:04 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.155 2017/12/13 18:45:08 krw Exp $ */
/* Parser for dhclient config and lease files. */
#include "dhctoken.h"
#include "log.h"
-void parse_client_statement(FILE *, char *, int);
+void parse_client_statement(FILE *, char *);
int parse_hex_octets(FILE *, unsigned int *, uint8_t **);
int parse_option_list(FILE *, int *, uint8_t *);
int parse_interface_declaration(FILE *, char *);
token = peek_token(NULL, cfile);
if (token == EOF)
break;
- parse_client_statement(cfile, name, 0);
+ parse_client_statement(cfile, name);
}
fclose(cfile);
}
* TOK_IGNORE option-list |
* TOK_INITIAL_INTERVAL number |
* TOK_INTERFACE interface-declaration |
- * TOK_LEASE client-lease-statement |
* TOK_LINK_TIMEOUT number |
* TOK_NEXT_SERVER string |
* TOK_PREPEND option-decl |
* TOK_SERVER_NAME string |
* TOK_SUPERSEDE option-decl |
* TOK_TIMEOUT number
- *
- * If nested == 1 then TOK_INTERFACE and TOK_LEASE are not allowed.
*/
void
-parse_client_statement(FILE *cfile, char *name, int nested)
+parse_client_statement(FILE *cfile, char *name)
{
uint8_t list[DHO_COUNT];
char *val;
parse_semi(cfile);
break;
case TOK_INTERFACE:
- if (nested == 1) {
- parse_warn("expecting statement.");
- skip_to_semi(cfile);
- } else if (parse_interface_declaration(cfile, name) == 1)
+ if (parse_interface_declaration(cfile, name) == 1)
;
break;
case TOK_LEASE:
break;
case TOK_LINK_TIMEOUT:
if (parse_lease_time(cfile, &config->link_timeout) == 1)
- parse_semi(cfile);
+ parse_semi(cfile);
break;
case TOK_NEXT_SERVER:
if (parse_ip_addr(cfile, &config->next_server) == 1)
token = next_token(NULL, cfile);
return 1;
}
- parse_client_statement(cfile, name, 1);
+ parse_client_statement(cfile, name);
}
return 0;
-.\" $OpenBSD: dhclient.conf.5,v 1.38 2017/12/07 21:47:22 jmc Exp $
+.\" $OpenBSD: dhclient.conf.5,v 1.39 2017/12/13 18:45:08 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: December 7 2017 $
+.Dd $Mdocdate: December 13 2017 $
.Dt DHCLIENT.CONF 5
.Os
.Sh NAME
Apply any
.Ar declaration
only to the named interface.
-.Ar interface
-declarations cannot be nested.
.It Ic reject Ar ip-address ;
Discard leases from the specified address.
If more than one