diff options
author | Susant Sahani <ssahani@vmware.com> | 2020-04-23 14:31:47 +0200 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2020-05-17 11:18:29 +0200 |
commit | 35f6a5cb44109c2dcb9fe059bcf9a6ad2354b709 (patch) | |
tree | a035d8b25567a738719367abec6bb7280a34c71d /src/network/networkd-dhcp4.c | |
parent | sd-dhcp6: Allow to add arbitary request option (diff) | |
download | systemd-35f6a5cb44109c2dcb9fe059bcf9a6ad2354b709.tar.xz systemd-35f6a5cb44109c2dcb9fe059bcf9a6ad2354b709.zip |
network: DHCPv6 - Add support set arbitary request options
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r-- | src/network/networkd-dhcp4.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index ada14ecd18..7d52a3a6a1 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1659,72 +1659,6 @@ int config_parse_dhcp_user_class( return 0; } -int config_parse_dhcp_request_options( - 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) { - - Network *network = data; - const char *p; - int r; - - assert(filename); - assert(lvalue); - assert(rvalue); - assert(data); - - if (isempty(rvalue)) { - network->dhcp_request_options = set_free(network->dhcp_request_options); - return 0; - } - - for (p = rvalue;;) { - _cleanup_free_ char *n = NULL; - uint32_t i; - - r = extract_first_word(&p, &n, NULL, 0); - if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to parse DHCP request option, ignoring assignment: %s", - rvalue); - return 0; - } - if (r == 0) - return 0; - - r = safe_atou32(n, &i); - if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, - "DHCP request option is invalid, ignoring assignment: %s", n); - continue; - } - - if (i < 1 || i >= 255) { - log_syntax(unit, LOG_ERR, filename, line, r, - "DHCP request option is invalid, valid range is 1-254, ignoring assignment: %s", n); - continue; - } - - r = set_ensure_allocated(&network->dhcp_request_options, NULL); - if (r < 0) - return log_oom(); - - r = set_put(network->dhcp_request_options, UINT32_TO_PTR(i)); - if (r < 0) - log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to store DHCP request option '%s', ignoring assignment: %m", n); - } - - return 0; -} - int config_parse_dhcp_ip_service_type( const char *unit, const char *filename, |