Changes since 4.2.5
+- Silence benign static analysis warnings.
+ [ISC-Bugs #33428]
+
- Add check for 64-bit package for atf.
[ISC-Bugs #32206]
Parser for dhclient config and lease files... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
break;
parse_client_statement (cfile, ip, client);
} while (1);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
status = (cfile -> warnings_occurred
? DHCP_R_BADPARSE
: ISC_R_SUCCESS);
switch (peek_token (&val, (unsigned *)0, cfile)) {
case INCLUDE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING) {
parse_warn (cfile, "filename string expected.");
return;
case KEY:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (ip) {
/* This may seem arbitrary, but there's a reason for
doing it: the authentication key database is not
case TOKEN_ALSO:
/* consume ALSO */
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
/* consume type of ALSO list. */
token = next_token(&val, NULL, cfile);
/* REQUIRE can either start a policy statement or a
comma-separated list of names of required options. */
case REQUIRE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == AUTHENTICATION) {
policy = P_REQUIRE;
return;
case IGNORE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
policy = P_IGNORE;
goto do_policy;
case ACCEPT:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
policy = P_ACCEPT;
goto do_policy;
case PREFER:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
policy = P_PREFER;
goto do_policy;
case DONT:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
policy = P_DONT;
goto do_policy;
break;
case OPTION:
- token = next_token (&val, (unsigned *)0, cfile);
-
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SPACE) {
if (ip) {
return;
case MEDIA:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_string_list (cfile, &config -> media, 1);
return;
case HARDWARE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (ip) {
parse_hardware_param (cfile, &ip -> hw_address);
} else {
return;
case ANYCAST_MAC:
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
if (ip != NULL) {
parse_hardware_param(cfile, &ip->anycast_mac_addr);
} else {
return;
case REQUEST:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (config -> requested_options == default_requested_options)
config -> requested_options = NULL;
parse_option_list (cfile, &config -> requested_options);
return;
case TIMEOUT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> timeout);
return;
case RETRY:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> retry_interval);
return;
case SELECT_TIMEOUT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> select_interval);
return;
case OMAPI:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != PORT) {
parse_warn (cfile,
return;
case DO_FORWARD_UPDATE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (!strcasecmp (val, "on") ||
!strcasecmp (val, "true"))
return;
case REBOOT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> reboot_timeout);
return;
case BACKOFF_CUTOFF:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> backoff_cutoff);
return;
case INITIAL_INTERVAL:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> initial_interval);
return;
case INITIAL_DELAY:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> initial_delay);
return;
case SCRIPT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_string (cfile, &config -> script_name, (unsigned *)0);
return;
case VENDOR:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != OPTION) {
parse_warn (cfile, "expecting 'vendor option space'");
return;
case INTERFACE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (ip)
parse_warn (cfile, "nested interface declaration.");
parse_interface_declaration (cfile, config, (char *)0);
return;
case PSEUDO:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
name = dmalloc (strlen (val) + 1, MDL);
if (!name)
return;
case LEASE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_client_lease_statement (cfile, 1);
return;
case ALIAS:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_client_lease_statement (cfile, 2);
return;
case REJECT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_reject_statement (cfile, config);
return;
}
if (!is_identifier (token)) {
parse_warn (cfile, "%s: expected option name.", val);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
skip_to_semi (cfile);
return 0;
}
break;
parse_client_statement (cfile, ip, client -> config);
} while (1);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
}
int interface_or_dummy (struct interface_info **pi, const char *name)
break;
parse_client_lease_declaration (cfile, lease, &ip, &client);
} while (1);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* If the lease declaration didn't include an interface
declaration that we recognized, it's of no use to us. */
DHCP Client. */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
long temp;
int e;
- oldpid = 0;
if ((pidfd = fopen(path_dhclient_pid, "r")) != NULL) {
e = fscanf(pidfd, "%ld\n", &temp);
oldpid = (pid_t)temp;
else if (pid)
exit (0);
/* Become session leader and get pid... */
- pid = setsid ();
+ (void) setsid ();
/* Close standard I/O descriptors. */
- close(0);
- close(1);
- close(2);
+ (void) close(0);
+ (void) close(1);
+ (void) close(2);
/* Reopen them on /dev/null. */
- open("/dev/null", O_RDWR);
- open("/dev/null", O_RDWR);
- open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
write_client_pid_file ();
* MAC address.
*/
result = 0;
+ POST(result);
memset(&client_identifier, 0, sizeof(client_identifier));
if (client->active_lease != NULL) {
if (((oc =
Memory allocation... */
/*
- * Copyright (c) 2009,2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
option_cache_dereference ((struct option_cache **)
(&car -> car), MDL);
dfree (car, MDL);
- car = cdr;
}
dfree (option_chain_head, file, line);
Lexical scanner for dhcpd config file... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
goto again;
default:
cfile -> tokbuf [i] = c;
- bs = 0;
break;
}
bs = 0;
Support for executable statements. */
/*
- * Copyright (c) 2009,2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998-2003 by Internet Software Consortium
*
#if defined (DEBUG_EXPRESSIONS)
log_debug ("exec: evaluate: %s",
(status ? "succeeded" : "failed"));
+#else
+ POST(status);
#endif
break;
#if defined (DEBUG_EXPRESSIONS)
log_debug ("exec: return: %s",
(status ? "succeeded" : "failed"));
+#else
+ POST(status);
#endif
break;
if (!scope) {
log_error("set %s: no scope",
r->data.set.name);
- status = 0;
break;
}
if (!*scope) {
if (!binding_scope_allocate(scope, MDL)) {
log_error("set %s: can't allocate scope",
r->data.set.name);
- status = 0;
break;
}
}
binding = find_binding(*scope, r->data.set.name);
#if defined (DEBUG_EXPRESSIONS)
log_debug("exec: set %s", r->data.set.name);
+#else
+ POST(status);
#endif
if (binding == NULL) {
binding = dmalloc(sizeof(*binding), MDL);
#if defined (DEBUG_EXPRESSIONS)
log_debug ("exec: set %s%s", r -> data.set.name,
(binding && status ? "" : " (failed)"));
+#else
+ POST(status);
#endif
break;
case unset_statement:
- if (!scope || !*scope) {
- status = 0;
+ if (!scope || !*scope)
break;
- }
binding = find_binding (*scope, r -> data.unset);
if (binding) {
if (binding -> value)
#if defined (DEBUG_EXPRESSIONS)
log_debug ("exec: unset %s: %s", r -> data.unset,
(status ? "found" : "not found"));
+#else
+ POST(status);
#endif
break;
#if defined (DEBUG_EXPRESSIONS)
log_debug("exec: let %s%s", e->data.let.name,
(binding && status ? "" : "failed"));
+#else
+ POST(status);
#endif
if (!e->data.let.statements) {
} else if (e->data.let.statements->op ==
}
if (r -> data.on.evtypes & ON_COMMIT) {
fprintf (file, "%scommit", s);
- s = "or";
+ s = " or ";
}
if (r -> data.on.evtypes & ON_RELEASE) {
fprintf (file, "%srelease", s);
- s = "or";
+ /* s = " or "; */
}
if (r -> data.on.statements) {
fprintf (file, " {");
case eval_statement:
indent_spaces (file, indent);
fprintf (file, "eval ");
- col = write_expression (file, r -> data.eval,
+ (void) write_expression (file, r -> data.eval,
indent + 5, indent + 5, 1);
fprintf (file, ";");
break;
fprintf (file, "set ");
col = token_print_indent (file, indent + 4, indent + 4,
"", "", r -> data.set.name);
- col = token_print_indent (file, col, indent + 4,
+ (void) token_print_indent (file, col, indent + 4,
" ", " ", "=");
col = write_expression (file, r -> data.set.expr,
indent + 3, indent + 3, 0);
- col = token_print_indent (file, col, indent + 4,
+ (void) token_print_indent (file, col, indent + 4,
" ", "", ";");
break;
fprintf (file, "unset ");
col = token_print_indent (file, indent + 6, indent + 6,
"", "", r -> data.set.name);
- col = token_print_indent (file, col, indent + 6,
+ (void) token_print_indent (file, col, indent + 6,
" ", "", ";");
break;
"", "", "(");
switch (r -> data.log.priority) {
case log_priority_fatal:
- col = token_print_indent
+ (void) token_print_indent
(file, col, indent + 4, "",
" ", "fatal,");
break;
case log_priority_error:
- col = token_print_indent
+ (void) token_print_indent
(file, col, indent + 4, "",
" ", "error,");
break;
case log_priority_debug:
- col = token_print_indent
+ (void) token_print_indent
(file, col, indent + 4, "",
" ", "debug,");
break;
case log_priority_info:
- col = token_print_indent
+ (void) token_print_indent
(file, col, indent + 4, "",
" ", "info,");
break;
}
col = write_expression (file, r -> data.log.expr,
indent + 4, indent + 4, 0);
- col = token_print_indent (file, col, indent + 4,
+ (void) token_print_indent (file, col, indent + 4,
"", "", ");");
break;
col = token_print_indent(file, col, indent + 4, "", " ", ",");
col = write_expression (file, expr->data.arg.val, col, indent + 4, 0);
}
- col = token_print_indent(file, col, indent + 4, "", "", ");");
+ (void) token_print_indent(file, col, indent + 4, "", "", ");");
#else /* !ENABLE_EXECUTE */
log_fatal("Impossible case at %s:%d (ENABLE_EXECUTE "
"is not defined).", MDL);
responses. */
/*
- * Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2011,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
void trace_icmp_output_input (trace_type_t *ttype, unsigned length, char *buf)
{
- struct icmp *icmp;
struct iaddr ia;
- if (length != (sizeof (*icmp) + (sizeof ia))) {
+ if (length != (sizeof (struct icmp) + sizeof (ia))) {
log_error ("trace_icmp_output_input: data size mismatch %d:%d",
- length, (int)((sizeof (*icmp)) + (sizeof ia)));
+ length, (int)(sizeof (struct icmp) + sizeof (ia)));
return;
}
ia.len = 4;
memcpy (ia.iabuf, buf, 4);
- icmp = (struct icmp *)(buf + 1);
log_error ("trace_icmp_output_input: unsent ping to %s", piaddr (ia));
}
way... */
/*
- * Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2011,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2007-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
if (addr->len != match->addr.len)
return 0;
- i = 0;
for (i = 0 ; i < addr->len ; i++) {
if ((addr->iabuf[i] & match->mask.iabuf[i]) !=
match->addr.iabuf[i])
Common parser code for dhcpd and dhclient. */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == RBRACE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (brace_count) {
if (!--brace_count)
return;
} else if (token == LBRACE) {
brace_count++;
} else if (token == SEMI && !brace_count) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
return;
} else if (token == EOL) {
/* EOL only happens when parsing /etc/resolv.conf,
and we treat it like a semicolon because the
resolv.conf file is line-oriented. */
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
return;
}
token = next_token (&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (!is_identifier (token) && token != NUMBER)
break;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Store this identifier... */
if (!(s = (char *)dmalloc (strlen (val) + 1, MDL)))
* we're dealing with.
*/
save_parse_state(cfile);
- (void) next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
if (next_token(NULL, NULL, cfile) == DOT &&
next_token(NULL, NULL, cfile) == NUMBER)
ipaddr = 1;
token = peek_token(&val, NULL, cfile);
if (token == SLASH) {
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
token = next_token(&val, NULL, cfile);
if (token != NUMBER) {
dfree(bufp, MDL);
return (unsigned char *)0;
}
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
}
token = next_token (&val, (unsigned *)0, cfile);
/* "never", "epoch" or day of week */
token = peek_token(&val, NULL, cfile);
if (token == NEVER) {
- token = next_token(&val, NULL, cfile); /* consume NEVER */
+ skip_token(&val, NULL, cfile); /* consume NEVER */
return(MAX_TIME);
}
/* This indicates 'local' time format. */
if (token == EPOCH) {
- token = next_token(&val, NULL, cfile); /* consume EPOCH */
+ skip_token(&val, NULL, cfile); /* consume EPOCH */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "Seconds since epoch expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume number */
+ skip_token(&val, NULL, cfile); /* consume number */
guess = atoi(val);
return((TIME)guess);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric day of week expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume day of week */
+ skip_token(&val, NULL, cfile); /* consume day of week */
/* we are not using this for anything */
/* Year... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric year expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume year */
+ skip_token(&val, NULL, cfile); /* consume year */
/* Note: the following is not a Y2K bug - it's a Y1.9K bug. Until
somebody invents a time machine, I think we can safely disregard
token = peek_token(&val, NULL, cfile);
if (token != SLASH) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile,
"expected slash separating year from month.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume SLASH */
+ skip_token(&val, NULL, cfile); /* consume SLASH */
/* Month... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric month expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume month */
+ skip_token(&val, NULL, cfile); /* consume month */
mon = atoi(val) - 1;
/* Slash separating month from day... */
token = peek_token(&val, NULL, cfile);
if (token != SLASH) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile,
"expected slash separating month from day.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume SLASH */
+ skip_token(&val, NULL, cfile); /* consume SLASH */
/* Day of month... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric day of month expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume day of month */
+ skip_token(&val, NULL, cfile); /* consume day of month */
mday = atoi(val);
/* Hour... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric hour expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume hour */
+ skip_token(&val, NULL, cfile); /* consume hour */
hour = atoi(val);
/* Colon separating hour from minute... */
token = peek_token(&val, NULL, cfile);
if (token != COLON) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile,
"expected colon separating hour from minute.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume colon */
+ skip_token(&val, NULL, cfile); /* consume colon */
/* Minute... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric minute expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume minute */
+ skip_token(&val, NULL, cfile); /* consume minute */
min = atoi(val);
/* Colon separating minute from second... */
token = peek_token(&val, NULL, cfile);
if (token != COLON) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile,
"expected colon separating minute from second.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume colon */
+ skip_token(&val, NULL, cfile); /* consume colon */
/* Second... */
token = peek_token(&val, NULL, cfile);
if (token != NUMBER) {
if (token != SEMI)
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "numeric second expected.");
return((TIME)0);
}
- token = next_token(&val, NULL, cfile); /* consume second */
+ skip_token(&val, NULL, cfile); /* consume second */
sec = atoi(val);
tzoff = 0;
token = peek_token(&val, NULL, cfile);
if (token == NUMBER) {
- token = next_token(&val, NULL, cfile); /* consume tzoff */
+ skip_token(&val, NULL, cfile); /* consume tzoff */
tzoff = atoi(val);
} else if (token != SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile,
"Time zone offset or semicolon expected.");
return((TIME)0);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == DOT) {
/* Go ahead and take the DOT token... */
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* The next token should be an identifier... */
token = next_token (&val, (unsigned *)0, cfile);
char *nu_name;
int tsize=1, lsize=1, hsize = 0;
- next_token (&val, (unsigned *)0, cfile); /* Discard the SPACE token,
+ skip_token(&val, (unsigned *)0, cfile); /* Discard the SPACE token,
which was checked by the
caller. */
token = next_token (&val, (unsigned *)0, cfile);
/* Consume optional compression indicator. */
token = peek_token(&val, NULL, cfile);
if (token == COMPRESSED) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
tokbuf[tokix++] = 'D';
type = 'c';
} else
token = peek_token (&val, (unsigned *)0, cfile);
if (token != COLON)
break;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
} while (1);
if (!buffer_allocate (&data -> buffer, tlen + ilen, MDL))
token = peek_token (&val, (unsigned *)0, cfile);
switch (token) {
case DB_TIME_FORMAT:
- next_token(&val, NULL, cfile);
-
+ skip_token(&val, NULL, cfile);
token = next_token(&val, NULL, cfile);
if (token == DEFAULT) {
db_time_format = DEFAULT_TIME_FORMAT;
return 1;
case IF:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
return parse_if_statement (result, cfile, lose);
case TOKEN_ADD:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING) {
parse_warn (cfile, "expecting class name.");
break;
case BREAK:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_semi (cfile)) {
*lose = 1;
return 0;
break;
case SEND:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
known = 0;
status = parse_option_name (cfile, 0, &known, &option);
if (status != ISC_R_SUCCESS || option == NULL) {
case SUPERSEDE:
case OPTION:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
known = 0;
status = parse_option_name (cfile, 0, &known, &option);
if (status != ISC_R_SUCCESS || option == NULL) {
case IGNORE:
flag = 2;
pad:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
cache = (struct option_cache *)0;
if (!parse_allow_deny (&cache, cfile, flag))
return 0;
break;
case DEFAULT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == COLON)
goto switch_default;
return status;
case PREPEND:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
known = 0;
status = parse_option_name (cfile, 0, &known, &option);
if (status != ISC_R_SUCCESS || option == NULL) {
return status;
case APPEND:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
known = 0;
status = parse_option_name (cfile, 0, &known, &option);
if (status != ISC_R_SUCCESS || option == NULL) {
return status;
case ON:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
return parse_on_statement (result, cfile, lose);
case SWITCH:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
return parse_switch_statement (result, cfile, lose);
case CASE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (case_context == context_any) {
parse_warn (cfile,
"case statement in inappropriate scope.");
cfile, lose, case_context);
switch_default:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (case_context == context_any) {
parse_warn (cfile, "switch default statement in %s",
"inappropriate scope.");
case DEFINE:
case TOKEN_SET:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (token == DEFINE)
flag = 1;
else
break;
case UNSET:
- token = next_token (&val, (unsigned *)0, cfile);
-
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != NAME && token != NUMBER_OR_NAME) {
parse_warn (cfile,
break;
case EVAL:
- token = next_token (&val, (unsigned *)0, cfile);
-
+ skip_token(&val, (unsigned *)0, cfile);
if (!executable_statement_allocate (result, MDL))
log_fatal ("no memory for eval statement.");
(*result) -> op = eval_statement;
case EXECUTE:
#ifdef ENABLE_EXECUTE
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
if (!executable_statement_allocate (result, MDL))
log_fatal ("no memory for execute statement.");
break;
case RETURN:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!executable_statement_allocate (result, MDL))
log_fatal ("no memory for return statement.");
break;
case LOG:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!executable_statement_allocate (result, MDL))
log_fatal ("no memory for log statement.");
i = 0;
}
if (i) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != COMMA) {
parse_warn (cfile, "comma expected.");
because it's appropriate for all DHCP agents with
parsers. */
case ZONE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
zone = (struct dns_zone *)0;
if (!dns_zone_allocate (&zone, MDL))
log_fatal ("no memory for new zone.");
/* Also not really a statement, but same idea as above. */
case KEY:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_key (cfile)) {
*lose = 1;
return 0;
config_universe->name_hash,
val, 0, MDL);
if (option) {
- token = next_token (&val,
- (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
status = parse_option_statement
(result, cfile, 1, option,
supersede_option_statement);
log_fatal ("can't allocate secondary.");
oc = zone -> secondary;
consemup:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
do {
struct expression *expr = (struct expression *)0;
if (!parse_ip_addr_or_hostname (&expr, cfile, 0)) {
"option cache.");
oc = zone->secondary6;
consemup6:
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
do {
struct expression *expr = NULL;
if (parse_ip6_addr_expr(&expr, cfile) == 0) {
break;
case KEY:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
key_name = (char *)0;
} else {
key_name = parse_host_name (cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
key -> name = dmalloc (strlen (val) + 1, MDL);
if (!key -> name)
log_fatal ("no memory for key name.");
/* Allow the BIND 8 syntax, which has a semicolon after each
closing brace. */
token = peek_token (&val, (unsigned *)0, cfile);
- if (token == SEMI)
- token = next_token (&val, (unsigned *)0, cfile);
+ if (token == SEMI) {
+ skip_token(&val, (unsigned *)0, cfile);
+ }
/* Remember the key. */
status = omapi_auth_key_enter (key);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == LPAREN) {
parenp = 1;
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
} else
parenp = 0;
}
token = peek_token (&val, (unsigned *)0, cfile);
if (token == ELSE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == IF) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_if_statement (&(*result) -> data.ie.fc,
cfile, lose)) {
if (!*lose)
executable_statement_dereference (result, MDL);
return 0;
} else {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!(parse_executable_statements
(&(*result) -> data.ie.fc,
cfile, lose, context_any))) {
}
}
} else if (token == ELSIF) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_if_statement (&(*result) -> data.ie.fc,
cfile, lose)) {
if (!*lose)
/* Check for unary operators... */
switch (token) {
case CHECK:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING) {
parse_warn (cfile, "string expected.");
break;
case TOKEN_NOT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
#if defined(NSUPDATE_OLD)
if (context == context_dns) {
token = peek_token (&val, (unsigned *)0, cfile);
break;
case LPAREN:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_expression (expr, cfile, lose, context,
(struct expression **)0, expr_none)) {
if (!*lose) {
if (context == context_dns)
goto ns_exists;
#endif
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_exists;
break;
case STATIC:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_static;
break;
case KNOWN:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_known;
break;
case SUBSTRING:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_substring;
break;
case SUFFIX:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_suffix;
break;
case LCASE:
- token = next_token(&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate(expr, MDL))
log_fatal ("can't allocate expression");
(*expr)->op = expr_lcase;
break;
case UCASE:
- token = next_token(&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate(expr, MDL))
log_fatal ("can't allocate expression");
(*expr)->op = expr_ucase;
break;
case CONCAT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_concat;
break;
case BINARY_TO_ASCII:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_binary_to_ascii;
break;
case REVERSE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_reverse;
case PICK:
/* pick (a, b, c) actually produces an internal representation
that looks like pick (a, pick (b, pick (c, nil))). */
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!(expression_allocate (expr, MDL)))
log_fatal ("can't allocate expression");
parse_warn (cfile,
"Please rebuild dhcpd with --with-nsupdate.");
#endif
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (token == DNS_UPDATE)
opcode = expr_ns_add;
else
parse_warn (cfile,
"Please rebuild dhcpd with --with-nsupdate.");
#endif
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = (token == OPTION
? expr_option
: expr_config_option);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
known = 0;
/* Pass reference directly to expression structure. */
status = parse_option_name(cfile, 0, &known,
break;
case HARDWARE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_hardware;
break;
case LEASED_ADDRESS:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_leased_address;
break;
case CLIENT_STATE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_client_state;
break;
case FILENAME:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_filename;
break;
case SERVER_NAME:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_sname;
break;
case LEASE_TIME:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_lease_time;
break;
case TOKEN_NULL:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_null;
break;
case HOST_DECL_NAME:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_host_decl_name;
#if defined(NSUPDATE_OLD)
case UPDATED_DNS_RR:
- token = next_token (&val, (unsigned *)0, cfile);
-
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != LPAREN)
goto nolparen;
break;
#endif /* NSUPDATE_OLD */
case PACKET:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_packet;
break;
case STRING:
- token = next_token (&val, &len, cfile);
+ skip_token(&val, &len, cfile);
if (!make_const_data (expr, (const unsigned char *)val,
len, 1, 1, MDL))
log_fatal ("can't make constant string expression.");
break;
case EXTRACT_INT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != LPAREN) {
parse_warn (cfile, "left parenthesis expected.");
break;
case ENCODE_INT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != LPAREN) {
parse_warn (cfile, "left parenthesis expected.");
number, by itself. */
if (context == context_numeric ||
context == context_data_or_numeric) {
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_const_int;
known = FORMERR;
goto ns_const;
ns_const:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_const_int;
goto ns_const;
case DEFINED:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != LPAREN)
goto nolparen;
/* This parses 'gethostname()'. */
case GETHOSTNAME:
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
if (!expression_allocate(expr, MDL))
log_fatal("can't allocate expression");
(*expr)->op = expr_gethostname;
break;
case GETHOSTBYNAME:
- token = next_token(&val, NULL, cfile);
-
+ skip_token(&val, NULL, cfile);
token = next_token(NULL, NULL, cfile);
if (token != LPAREN)
goto nolparen;
if (token != NAME && token != NUMBER_OR_NAME)
return 0;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Save the name of the variable being referenced. */
cptr = dmalloc (strlen (val) + 1, MDL);
break;
}
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!expression_allocate (expr, MDL))
log_fatal ("can't allocate expression");
(*expr) -> op = expr_funcall;
token = peek_token (&val, (unsigned *)0, cfile);
switch (token) {
case BANG:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token != EQUAL) {
parse_warn (cfile, "! in boolean context without =");
case TILDE:
#ifdef HAVE_REGEX_H
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
token = peek_token(&val, NULL, cfile);
if (token == TILDE)
lhs = rhs;
rhs = (struct expression *)0;
binop = next_op;
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
goto new_rhs;
}
/* Eat the subexpression operator token, which we pass to
* parse_expression...we only peek()'d earlier.
*/
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Continue parsing of the right hand side with that token. */
tmp = rhs;
}
/* Eat the operator token - we now know it was a binary operator... */
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Now combine the LHS and the RHS using binop. */
tmp = (struct expression *)0;
token = peek_token (&val, (unsigned *)0, cfile);
/* Comma means: continue with next element in array */
if (token == COMMA) {
- token = next_token (&val,
- (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
continue;
}
/* no comma: end of array.
* we are parsing a zero-length option, so don't
* eat the semicolon token in that case.
*/
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
} else if (token == EQUAL) {
/* Eat the equals sign. */
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Parse a data expression and use its value for the data. */
if (!parse_data_expression (&expr, cfile, &lose)) {
if (freeval == ISC_TRUE) {
dfree((char *)val, MDL);
freeval = ISC_FALSE;
+ POST(freeval);
}
break;
} while (token == COLON);
val = (char *)buf;
} else if (token == STRING) {
- token = next_token (&val, &len, cfile);
+ skip_token(&val, &len, cfile);
if (len + 1 > max) {
parse_warn (cfile, "string constant too long.");
skip_to_semi (cfile);
do {
/* Consume the COMMA token if peeked. */
if (token == COMMA)
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
/* Get next (or first) value. */
token = next_token(&val, &len, cfile);
Turn data structures into printable text. */
/*
- * Copyright (c) 2009-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
}
va_end (list);
- len = token_print_indent (file, col, indent,
+ col = token_print_indent (file, col, indent,
prefix, suffix, t);
dfree (t, MDL);
return col;
{
int len = 0;
if (prefix != NULL)
- len = strlen (prefix);
+ len += strlen (prefix);
if (buf != NULL)
len += strlen (buf);
Parser for /etc/resolv.conf file. */
/*
- * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009,2013 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
(struct domain_search_list *)0;
*dp = nd;
nd -> domain = dn;
- dn = (char *)0;
}
nd -> rcdate = parse_time;
token = peek_token (&val,
"junk after domain declaration");
skip_to_semi (cfile);
}
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
} else if (token == NAMESERVER) {
struct name_server *ns, **sp;
struct iaddr iaddr;
} else
skip_to_semi (cfile); /* Ignore what we don't grok. */
} while (1);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/* Lose servers that are no longer in /etc/resolv.conf. */
sl = (struct name_server *)0;
BSD socket interface code... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
m.msg_control = control_buf;
m.msg_controllen = control_buf_len;
cmsg = CMSG_FIRSTHDR(&m);
+ INSIST(cmsg != NULL);
cmsg->cmsg_level = IPPROTO_IPV6;
cmsg->cmsg_type = IPV6_PKTINFO;
cmsg->cmsg_len = CMSG_LEN(sizeof(*pktinfo));
Routines for manipulating parse trees... */
/*
- * Copyright (c) 2011-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2011-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
strcpy (nb -> name, s -> string);
else {
dfree (nb, MDL);
- nb = (struct binding *)0;
goto blb;
}
}
} # ac_fn_c_try_link
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
fi
+for ac_func in strlcat
+do :
+ ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
+if test "x$ac_cv_func_strlcat" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRLCAT 1
+_ACEOF
+
+fi
+done
+
+
# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5
$as_echo_n "checking for library containing if_nametoindex... " >&6; }
# Check for a standalone regex library.
AC_SEARCH_LIBS(regcomp, [regex])
+AC_CHECK_FUNCS(strlcat)
+
# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
AC_SEARCH_LIBS(if_nametoindex, [ipv6])
Examine and modify omapi objects. */
/*
- * Copyright (c) 2009-2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2011,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2001-2003 by Internet Software Consortium
*
break;
}
- s1[0] = '\0';
- strncat (s1, val, sizeof(s1)-1);
+#ifdef HAVE_STRLCPY
+ strlcpy (s1, val, sizeof(s1));
+#else
+ s1[0] = 0;
+ strncat (s1, val, sizeof(s1)-strlen(s1)-1);
+#endif
token = next_token (&val, (unsigned *)0, cfile);
if (token != EQUAL)
break;
}
- s1[0] = '\0';
- strncat (s1, val, sizeof(s1)-1);
+#if HAVE_STRLCPY
+ strlcpy (s1, val, sizeof(s1));
+#else
+ s1[0] = 0;
+ strncat (s1, val, sizeof(s1)-strlen(s1)-1);
+#endif
token = next_token (&val, (unsigned *)0, cfile);
if (token != END_OF_FILE && token != EOL)
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
* Portions Copyright (c) 2007,2009 by Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (c) 2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 2012-2013 by Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
done_init = 1;
s = getenv("DSTKEYPATH");
- len = 0;
if (s) {
struct stat statbuf;
pubkey->dk_alg) == 0)
dg_key = dst_free_key(dg_key);
- pubkey = dst_free_key(pubkey);
+ (void) dst_free_key(pubkey);
return (dg_key);
}
static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.10 2012/03/09 11:18:13 tomasz Exp $";
#endif
/*
- * Portions Copyright (c) 2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 2012,2013 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
*
static int i = 0;
static unsigned long d_round = 0;
struct timeval tv;
- int n = 0, tb_i = 0, out = 0;
+ int n = 0, out = 0;
unsigned dir_len;
char file_name[1024];
EREPORT(("do_ls i %d filled %4d in_temp %4d\n",
i-1, work->filled, work->in_temp));
memcpy(tmp_buff, &buf, sizeof(buf));
- tb_i += sizeof(buf);
if ((dir = opendir(dirs[i-1])) == NULL)/* open it for read */
if (n < size) {
temp = dst_s_quick_random((int) buff[n - 1]);
memcpy(&buff[n], &temp, sizeof(temp));
- n += sizeof(temp);
}
/* covert this into a HMAC key */
new_key = dst_buffer_to_key("", KEY_HMAC_MD5, 0, 0, buff, size);
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
Definitions for dhcpd... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
struct parse *cfile);
enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen,
struct parse *cfile);
+/*
+ * Use skip_token when we are skipping a token we have previously
+ * used peek_token on as we know what the result will be in this case.
+ */
+#define skip_token(a,b,c) ((void) next_token((a),(b),(c)))
+
/* confpars.c */
void parse_trace_setup (void);
Subroutines for dealing with connections. */
/*
- * Copyright (c) 2009-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
addrs -> addresses [0].addrlen = sizeof foo;
memcpy (addrs -> addresses [0].address, &foo, sizeof foo);
addrs -> addresses [0].port = port;
- hix = 1;
}
status = omapi_connect_list (c, addrs, (omapi_addr_t *)0);
omapi_addr_list_dereference (&addrs, MDL);
s += sizeof remote.sin_addr;
memcpy (&local.sin_addr, s, sizeof local.sin_addr);
s += sizeof local.sin_addr;
+ POST(s);
connect_index = ntohl (connect_index);
listener_index = ntohl (listener_index);
DHCP/BOOTP Relay Agent. */
/*
- * Copyright(c) 2004-2012 by Internet Systems Consortium, Inc.("ISC")
+ * Copyright(c) 2004-2013 by Internet Systems Consortium, Inc.("ISC")
* Copyright(c) 1997-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
log_info(copyright);
log_info(arr);
log_info(url);
- } else {
- quiet = 0;
+ } else
log_perror = 0;
- }
/* Set default port */
if (local_family == AF_INET) {
}
}
- close(0);
- close(1);
- close(2);
- pid = setsid();
+ (void) close(0);
+ (void) close(1);
+ (void) close(2);
+ (void) setsid();
IGNORE_RET (chdir("/"));
}
if (end_pad != NULL)
sp = end_pad;
+#if 0
/* Remember where the end of the packet was after parsing
it. */
op = sp;
+#endif
/* Sanity check. Had better not ever happen. */
if ((ip->circuit_id_len > 255) ||(ip->circuit_id_len < 1))
}
}
/* Why bother when there is no choice. */
- if (!dp && !downstreams->next)
+ if (!dp && downstreams && !downstreams->next)
dp = downstreams;
if (!dp) {
log_info("Can't find the down interface.");
Parser for dhcpd config file... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
(struct host_decl *)0,
declaration);
} while (1);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
status = cfile->warnings_occurred ? DHCP_R_BADPARSE : ISC_R_SUCCESS;
return status;
switch (token) {
case INCLUDE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING) {
parse_warn (cfile, "filename string expected.");
return 1;
case HOST:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type != HOST_DECL && type != CLASS_DECL) {
if (global_host_once &&
(type == SUBNET_DECL || type == SHARED_NET_DECL)) {
return 1;
case GROUP:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type != HOST_DECL && type != CLASS_DECL)
parse_group_declaration (cfile, group);
else {
return 1;
case SHARED_NETWORK:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == SHARED_NET_DECL ||
type == HOST_DECL ||
type == SUBNET_DECL ||
case SUBNET:
case SUBNET6:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == HOST_DECL || type == SUBNET_DECL ||
type == CLASS_DECL) {
parse_warn (cfile,
return 1;
case VENDOR_CLASS:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == CLASS_DECL) {
parse_warn (cfile,
"class declarations not allowed here.");
return 1;
case USER_CLASS:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == CLASS_DECL) {
parse_warn (cfile,
"class declarations not allowed here.");
return 1;
case CLASS:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == CLASS_DECL) {
parse_warn (cfile,
"class declarations not allowed here.");
return 1;
case SUBCLASS:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == CLASS_DECL) {
parse_warn (cfile,
"class declarations not allowed here.");
return 1;
case HARDWARE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
memset (&hardware, 0, sizeof hardware);
if (host_decl && memcmp(&hardware, &(host_decl->interface),
sizeof(hardware)) != 0) {
case FIXED_ADDR:
case FIXED_ADDR6:
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
cache = NULL;
if (parse_fixed_addr_param(&cache, cfile, token)) {
if (host_decl) {
break;
case POOL:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type == POOL_DECL) {
parse_warn (cfile, "pool declared within pool.");
skip_to_semi(cfile);
return declaration;
case RANGE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (type != SUBNET_DECL || !group -> subnet) {
parse_warn (cfile,
"range declaration not allowed here.");
#ifdef DHCPv6
case RANGE6:
- next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
if ((type != SUBNET_DECL) || (group->subnet == NULL)) {
parse_warn (cfile,
"range6 declaration not allowed here.");
return declaration;
case PREFIX6:
- next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
if ((type != SUBNET_DECL) || (group->subnet == NULL)) {
parse_warn (cfile,
"prefix6 declaration not allowed here.");
return declaration;
case FIXED_PREFIX6:
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
if (!host_decl) {
parse_warn (cfile,
"fixed-prefix6 declaration not "
#endif /* DHCPv6 */
case TOKEN_NOT:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
switch (token) {
case AUTHORITATIVE:
}
break;
case AUTHORITATIVE:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
group -> authoritative = 1;
authoritative:
if (type == HOST_DECL)
&code, 0, MDL))
log_fatal("Server identifier not in hash (%s:%d).",
MDL);
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
goto finish_option;
case OPTION:
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SPACE) {
if (type != ROOT_GROUP) {
option_dereference(&option, MDL);
break;
}
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
/*
* If the option was known, remove it from the
token = peek_token (&val, (unsigned *)0, cfile);
switch (token) {
case TOKEN_NO:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != FAILOVER ||
(token = next_token (&val, (unsigned *)0,
#if defined (FAILOVER_PROTOCOL)
case FAILOVER:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != PEER) {
parse_warn (cfile, "expecting 'peer'.");
#endif
case RANGE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_address_range (cfile, group, type,
pool, &lpchain);
break;
permit = new_permit (MDL);
if (!permit)
log_fatal ("no memory for permit");
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
switch (token) {
case UNKNOWN:
goto get_permit;
case RBRACE:
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
done = 1;
break;
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == RBRACE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
break;
}
if (token == END_OF_FILE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_warn (cfile, "unexpected end of file");
break;
}
remember to save it. */
if (token == DYNAMIC) {
dynamicp = 1;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_semi (cfile))
break;
continue;
remember to save it. */
if (token == TOKEN_DELETED) {
deleted = 1;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_semi (cfile))
break;
continue;
if (token == GROUP) {
struct group_object *go;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING && !is_identifier (token)) {
parse_warn (cfile,
unsigned char *t = 0;
unsigned len;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
data_string_forget (&host -> client_identifier, MDL);
if (host->client_identifier.len != 0) {
/* See if it's a string or a cshl. */
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
- token = next_token (&val, &len, cfile);
+ skip_token(&val, &len, cfile);
s = val;
host -> client_identifier.terminated = 1;
} else {
skip_to_rbrace(cfile, 1);
break;
}
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
token = next_token(&val, NULL, cfile);
if (token != OPTION) {
parse_warn(cfile,
if (type == CLASS_TYPE_SUBCLASS) {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
- token = next_token (&val, &data.len, cfile);
+ skip_token(&val, &data.len, cfile);
data.buffer = (struct buffer *)0;
if (!buffer_allocate (&data.buffer,
data.len + 1, MDL)) {
if (class -> superclass) {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SEMI) {
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (cp)
status = class_reference (cp, class, MDL);
class_dereference (&class, MDL);
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == RBRACE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
break;
} else if (token == END_OF_FILE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_warn (cfile, "unexpected end of file");
break;
} else if (token == DYNAMIC) {
class->flags |= CLASS_DECL_DYNAMIC;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_semi (cfile))
break;
continue;
} else if (token == TOKEN_DELETED) {
class->flags |= CLASS_DECL_DELETED;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!parse_semi (cfile))
break;
continue;
skip_to_semi (cfile);
break;
}
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = peek_token (&val, (unsigned *)0, cfile);
if (token != IF)
goto submatch;
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (matchedonce) {
parse_warn(cfile, "A class may only have "
"one 'match if' clause.");
parse_semi (cfile);
}
} else if (token == SPAWN) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (pc) {
parse_warn (cfile,
"invalid spawn in subclass.");
parse_semi (cfile);
}
} else if (token == LEASE) {
- next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (token != LIMIT) {
parse_warn (cfile, "expecting \"limit\"");
/* Get the name of the shared network... */
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (val [0] == 0) {
parse_warn (cfile, "zero-length shared network name");
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == RBRACE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
if (!share -> subnets)
parse_warn (cfile,
"empty shared-network decl");
shared_network_dereference (&share, MDL);
return;
} else if (token == END_OF_FILE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
parse_warn (cfile, "unexpected end of file");
break;
} else if (token == INTERFACE) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
new_shared_network_interface (cfile, share, val);
if (!parse_semi (cfile))
do {
token = peek_token(&val, NULL, cfile);
if (token == RBRACE) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
break;
} else if (token == END_OF_FILE) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn (cfile, "unexpected end of file");
break;
} else if (token == INTERFACE) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
token = next_token(&val, NULL, cfile);
new_shared_network_interface(cfile, share, val);
if (!parse_semi(cfile))
token = peek_token(&val, NULL, cfile);
if (is_identifier (token) || token == STRING) {
- next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
name = dmalloc(strlen(val) + 1, MDL);
if (!name)
do {
token = peek_token(&val, NULL, cfile);
if (token == RBRACE) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
break;
} else if (token == END_OF_FILE) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_warn(cfile, "unexpected end of file");
break;
} else if (token == TOKEN_DELETED) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_semi(cfile);
deletedp = 1;
} else if (token == DYNAMIC) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_semi(cfile);
dynamicp = 1;
} else if (token == STATIC) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
parse_semi(cfile);
staticp = 1;
}
token = peek_token (&val, (unsigned *)0, cfile);
if (token == STRING) {
unsigned char *tuid;
- token = next_token (&val, &buflen, cfile);
+ skip_token(&val, &buflen, cfile);
if (buflen < sizeof lease -> uid_buf) {
tuid = lease -> uid_buf;
lease -> uid_max =
token = peek_token(&val, NULL, cfile);
if (token == STRING) {
- token = next_token(&val, &buflen, cfile);
+ skip_token(&val, &buflen, cfile);
value->type = binding_data;
value->value.data.len = buflen;
dfree (s, MDL);
}
} else if (token == PERCENT) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
token = next_token(&val, NULL, cfile);
if (token != NUMBER) {
parse_warn(cfile, "expecting decimal number.");
if ((token = peek_token (&val,
(unsigned *)0, cfile)) == DYNAMIC_BOOTP) {
- token = next_token (&val, (unsigned *)0, cfile);
+ skip_token(&val, (unsigned *)0, cfile);
dynamic = 1;
}
/*
* '/' means CIDR notation, so read the bits we want.
*/
- next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
token = next_token(&val, NULL, cfile);
if (token != NUMBER) {
parse_warn(cfile, "expecting number");
parse_warn(cfile, "temporary mask too short");
if (bits == 128)
parse_warn(cfile, "temporary singleton?");
- token = next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
type = D6O_IA_TA;
}
* temporary (RFC 4941)
*/
type = D6O_IA_TA;
- next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
bits = 64;
if (!is_cidr_mask_valid(&lo, bits)) {
parse_warn(cfile, "network mask too short");
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
*/
token = peek_token(&val, NULL, cfile);
if (token == SEMI) {
- token = next_token(&val, NULL, cfile);
+ skip_token(&val, NULL, cfile);
} else {
parse_warn(cfile,
"corrupt lease file; "
/*
* Consume the SERVER_DUID token.
*/
- token = next_token(NULL, NULL, cfile);
+ skip_token(NULL, NULL, cfile);
/*
* Obtain the DUID type.
DHCP Server Daemon. */
/*
- * Copyright (c) 2004-2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2011,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
if (daemon) {
/* Become session leader and get pid... */
- pid = setsid();
+ (void) setsid();
/* Close standard I/O descriptors. */
- close(0);
- close(1);
- close(2);
+ (void) close(0);
+ (void) close(1);
+ (void) close(2);
/* Reopen them on /dev/null. */
- open("/dev/null", O_RDWR);
- open("/dev/null", O_RDWR);
- open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
+ (void) open("/dev/null", O_RDWR);
log_perror = 0; /* No sense logging to /dev/null. */
IGNORE_RET (chdir("/"));
/*
- * Copyright (C) 2006-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2006-2013 by Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
send_addr.len = 16;
memcpy(send_addr.iabuf, reply->fixed.data, 16);
- status = ISC_R_SUCCESS;
scope = &global_scope;
group = reply->subnet->group;
goto send_addr;
}
memcpy(&send_pref, &l->cidrnet, sizeof(send_pref));
- status = ISC_R_SUCCESS;
scope = &global_scope;
goto send_pref;
}
Failover protocol support code... */
/*
- * Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
return omapi_make_int_value (value, name,
(int)link -> peer_port, MDL);
} else if (!omapi_ds_strcmp (name, "link-state")) {
- if (link -> state < 0 ||
- link -> state >= dhcp_flink_state_max)
+ if (link -> state >= dhcp_flink_state_max)
return omapi_make_string_value (value, name,
"invalid link state",
MDL);
status = omapi_connection_put_name (c, "link-state");
if (status != ISC_R_SUCCESS)
return status;
- if (link -> state < 0 ||
- link -> state >= dhcp_flink_state_max)
+ if (link -> state >= dhcp_flink_state_max)
status = omapi_connection_put_string (c, "invalid link state");
else
status = (omapi_connection_put_string