Commit f9717594 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

- Parameters configured to evaluate from user defined function calls can

  now be correctly written to dhcpd.leases.
- If a 'next-server' parameter is configured in a dynamic host record via
  OMAPI as a domain name, the syntax written to disk is now correctly parsed
  upon restart. [ISC-Bugs #22266]
parent 6f6b475c
......@@ -120,6 +120,14 @@ work on other platforms. Please report any problems and suggested fixes to
state to hopefully find an RFC 2131 compliant server (or retry in INIT
forever). [ISC-Bugs #19660]
- Parameters configured to evaluate from user defined function calls can
now be correctly written to dhcpd.leases (as on 'on events' or dynamic
host records inserted via OMAPI). [ISC-Bugs #22266]
- If a 'next-server' parameter is configured in a dynamic host record via
OMAPI as a domain name, the syntax written to disk is now correctly parsed
upon restart. [ISC-Bugs #22266]
Changes since 4.1-ESV-R1
! In dhclient check the data for some string options for
......
......@@ -968,6 +968,8 @@ intern(char *atom, enum dhcp_token dfv) {
return GROUP;
if (!strcasecmp (atom + 1, "et-lease-hostnames"))
return GET_LEASE_HOSTNAMES;
if (!strcasecmp(atom + 1, "ethostbyname"))
return GETHOSTBYNAME;
break;
case 'h':
if (!strcasecmp(atom + 1, "ash"))
......
......@@ -4527,6 +4527,31 @@ int parse_non_binary (expr, cfile, lose, context)
goto norparen;
break;
case GETHOSTBYNAME:
token = next_token(&val, NULL, cfile);
token = next_token(NULL, NULL, cfile);
if (token != LPAREN)
goto nolparen;
/* The argument is a quoted string. */
token = next_token(&val, NULL, cfile);
if (token != STRING) {
parse_warn(cfile, "Expecting quoted literal: "
"\"foo.example.com\"");
skip_to_semi(cfile);
*lose = 1;
return 0;
}
if (!make_host_lookup(expr, val))
log_fatal("Error creating gethostbyname() internal "
"record. (%s:%d)", MDL);
token = next_token(NULL, NULL, cfile);
if (token != RPAREN)
goto norparen;
break;
/* Not a valid start to an expression... */
default:
if (token != NAME && token != NUMBER_OR_NAME)
......
......@@ -3988,6 +3988,27 @@ int write_expression (file, expr, col, indent, firstp)
col = token_print_indent (file, col, indent, "", "", ")");
break;
case expr_funcall:
col = token_print_indent(file, indent, indent, "", "",
expr->data.funcall.name);
col = token_print_indent(file, col, indent, " ", "", "(");
firstp = 1;
e = expr->data.funcall.arglist;
while (e != NULL) {
if (!firstp)
col = token_print_indent(file, col, indent,
"", " ", ",");
col = write_expression(file, e->data.arg.val, col,
indent, firstp);
firstp = 0;
e = e->data.arg.next;
}
col = token_print_indent(file, col, indent, "", "", ")");
break;
default:
log_fatal ("invalid expression type in print_expression: %d",
expr -> op);
......
......@@ -355,7 +355,8 @@ enum dhcp_token {
PREFIX6 = 657,
FIXED_PREFIX6 = 658,
CONFLICT_DONE = 660,
INITIAL_DELAY = 664
INITIAL_DELAY = 664,
GETHOSTBYNAME = 665
};
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment