mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-03 15:56:00 +00:00
Handle the REJECT statement
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: clparse.c,v 1.10 1997/05/09 07:48:34 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: clparse.c,v 1.11 1997/06/02 22:34:19 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -307,6 +307,10 @@ void parse_client_statement (cfile, ip, config)
|
|||||||
parse_client_lease_statement (cfile, 2);
|
parse_client_lease_statement (cfile, 2);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case REJECT:
|
||||||
|
parse_reject_statement (cfile, config);
|
||||||
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
parse_warn ("expecting a statement.");
|
parse_warn ("expecting a statement.");
|
||||||
skip_to_semi (cfile);
|
skip_to_semi (cfile);
|
||||||
@@ -982,3 +986,36 @@ void parse_string_list (cfile, lp, multiple)
|
|||||||
skip_to_semi (cfile);
|
skip_to_semi (cfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void parse_reject_statement (cfile, config)
|
||||||
|
FILE *cfile;
|
||||||
|
struct client_config *config;
|
||||||
|
{
|
||||||
|
int token;
|
||||||
|
char *val;
|
||||||
|
struct iaddr addr;
|
||||||
|
struct iaddrlist *list;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (!parse_ip_addr (cfile, &addr)) {
|
||||||
|
parse_warn ("expecting IP address.");
|
||||||
|
skip_to_semi (cfile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
list = (struct iaddrlist *)malloc (sizeof (struct iaddrlist));
|
||||||
|
if (!list)
|
||||||
|
error ("no memory for reject list!");
|
||||||
|
|
||||||
|
list -> addr = addr;
|
||||||
|
list -> next = config -> reject_list;
|
||||||
|
config -> reject_list = list;
|
||||||
|
|
||||||
|
token = next_token (&val, cfile);
|
||||||
|
} while (token == COMMA);
|
||||||
|
|
||||||
|
if (token != SEMI) {
|
||||||
|
parse_warn ("expecting semicolon.");
|
||||||
|
skip_to_semi (cfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user