2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-01 14:55:30 +00:00

[master] Implement and use new option format type 'k'

Merges in #68.
This commit is contained in:
Thomas Markwalder
2019-12-17 13:59:24 -05:00
parent 79cfe1acf3
commit 9a2f9db55f
11 changed files with 59 additions and 16 deletions

View File

@@ -5058,7 +5058,33 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups)
POST(freeval);
}
break;
case 'k': /* key name */
token = peek_token (&val, &len, cfile);
if (token == STRING) {
token = next_token (&val, &len, cfile);
} else {
val = parse_host_name(cfile);
if (!val) {
parse_warn(cfile, "not a valid key name.");
skip_to_semi(cfile);
return 0;
}
freeval = ISC_TRUE;
}
if (!make_const_data (&t, (const unsigned char *)val,
strlen(val), 1, 1, MDL)) {
log_fatal ("No memory key name");
}
if (freeval == ISC_TRUE) {
dfree((char *)val, MDL);
freeval = ISC_FALSE;
}
break;
case 'N':
f = (*fmt) + 1;
g = strchr (*fmt, '.');