diff options
Diffstat (limited to 'src/network/networkd-dhcp-common.c')
-rw-r--r-- | src/network/networkd-dhcp-common.c | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c index 4826d15e80..0d1dc2e8ed 100644 --- a/src/network/networkd-dhcp-common.c +++ b/src/network/networkd-dhcp-common.c @@ -507,7 +507,7 @@ int config_parse_iaid(const char *unit, return 0; } -int config_parse_dhcp_user_class( +int config_parse_dhcp_user_or_vendor_class( const char *unit, const char *filename, unsigned line, @@ -525,6 +525,7 @@ int config_parse_dhcp_user_class( assert(l); assert(lvalue); assert(rvalue); + assert(IN_SET(ltype, AF_INET, AF_INET6)); if (isempty(rvalue)) { *l = strv_free(*l); @@ -567,57 +568,6 @@ int config_parse_dhcp_user_class( } } -int config_parse_dhcp_vendor_class( - const char *unit, - const char *filename, - unsigned line, - const char *section, - unsigned section_line, - const char *lvalue, - int ltype, - const char *rvalue, - void *data, - void *userdata) { - char ***l = data; - int r; - - assert(l); - assert(lvalue); - assert(rvalue); - - if (isempty(rvalue)) { - *l = strv_free(*l); - return 0; - } - - for (const char *p = rvalue;;) { - _cleanup_free_ char *w = NULL; - - r = extract_first_word(&p, &w, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNQUOTE); - if (r == -ENOMEM) - return log_oom(); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, - "Failed to split vendor classes option, ignoring: %s", rvalue); - return 0; - } - if (r == 0) - return 0; - - if (strlen(w) > UINT8_MAX) { - log_syntax(unit, LOG_WARNING, filename, line, 0, - "%s length is not in the range 1-255, ignoring.", w); - continue; - } - - r = strv_push(l, w); - if (r < 0) - return log_oom(); - - w = NULL; - } -} - int config_parse_dhcp_send_option( const char *unit, const char *filename, |