From bd319a91666233bc880e0302e9af0ee752e13635 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 7 Apr 2021 09:30:56 -0600 Subject: [PATCH] interface-file: adjust the special handling for hostname properties to use dhcp-hostname closes #148 --- libifupdown/interface-file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libifupdown/interface-file.c b/libifupdown/interface-file.c index b70c514..06d76d7 100644 --- a/libifupdown/interface-file.c +++ b/libifupdown/interface-file.c @@ -250,8 +250,8 @@ handle_hostname(struct lif_interface_file_parse_state *state, char *token, char return true; } - lif_dict_delete(&state->cur_iface->vars, token); - lif_dict_add(&state->cur_iface->vars, token, strdup(hostname)); + lif_dict_delete(&state->cur_iface->vars, "dhcp-hostname"); + lif_dict_add(&state->cur_iface->vars, "dhcp-hostname", strdup(hostname)); return true; } @@ -447,6 +447,7 @@ struct parser_keyword { static const struct parser_keyword keywords[] = { {"address", handle_address}, {"auto", handle_auto}, + {"dhcp-hostname", handle_hostname}, {"gateway", handle_gateway}, {"hostname", handle_hostname}, {"iface", handle_iface},