]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: unify config_parse_dhcp_server_option_data() and config_parse_dhcp_send_option() 14064/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Nov 2019 09:29:29 +0000 (18:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Nov 2019 14:39:03 +0000 (23:39 +0900)
src/network/networkd-dhcp-common.c
src/network/networkd-dhcp-common.h
src/network/networkd-dhcp-server.c
src/network/networkd-dhcp-server.h
src/network/networkd-dhcp4.c
src/network/networkd-dhcp4.h
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h

index 7e42a6edd47de6fdf339d06e6e7cbabfd13d7262..7f8da46cf5d209f10936fd03db4ded3b4095e300 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
+#include "dhcp-internal.h"
+#include "escape.h"
 #include "in-addr-util.h"
 #include "networkd-dhcp-common.h"
 #include "networkd-network.h"
@@ -263,6 +265,167 @@ int config_parse_dhcp6_pd_hint(
         return 0;
 }
 
+int config_parse_dhcp_send_option(
+                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) {
+
+        _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt = NULL, *old = NULL;
+        _cleanup_free_ char *word = NULL, *q = NULL;
+        OrderedHashmap **options = userdata;
+        union in_addr_union addr;
+        DHCPOptionDataType type;
+        uint8_t u, uint8_data;
+        uint16_t uint16_data;
+        uint32_t uint32_data;
+        const void *udata;
+        const char *p;
+        ssize_t sz;
+        int r;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        if (isempty(rvalue)) {
+                *options = ordered_hashmap_free(*options);
+                return 0;
+        }
+
+        p = rvalue;
+        r = extract_first_word(&p, &word, ":", 0);
+        if (r == -ENOMEM)
+                return log_oom();
+        if (r <= 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Invalid DHCP option, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        r = safe_atou8(word, &u);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Invalid DHCP option, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+        if (u < 1 || u >= 255) {
+                log_syntax(unit, LOG_ERR, filename, line, 0,
+                           "Invalid DHCP option, valid range is 1-254, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        free(word);
+        r = extract_first_word(&p, &word, ":", 0);
+        if (r == -ENOMEM)
+                return log_oom();
+        if (r <= 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Invalid DHCP option, ignoring assignment: %s", rvalue);
+                return 0;
+        }
+
+        type = dhcp_option_data_type_from_string(word);
+        if (type < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, 0,
+                           "Invalid DHCP option data type, ignoring assignment: %s", p);
+                return 0;
+        }
+
+        switch(type) {
+        case DHCP_OPTION_DATA_UINT8:{
+                r = safe_atou8(p, &uint8_data);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r,
+                                   "Failed to parse DHCPv4 uint8 data, ignoring assignment: %s", p);
+                        return 0;
+                }
+
+                udata = &uint8_data;
+                sz = sizeof(uint8_t);
+                break;
+        }
+        case DHCP_OPTION_DATA_UINT16:{
+                r = safe_atou16(p, &uint16_data);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r,
+                                   "Failed to parse DHCPv4 uint16 data, ignoring assignment: %s", p);
+                        return 0;
+                }
+
+                udata = &uint16_data;
+                sz = sizeof(uint16_t);
+                break;
+        }
+        case DHCP_OPTION_DATA_UINT32: {
+                r = safe_atou32(p, &uint32_data);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r,
+                                   "Failed to parse DHCPv4 uint32 data, ignoring assignment: %s", p);
+                        return 0;
+                }
+
+                udata = &uint32_data;
+                sz = sizeof(uint32_t);
+
+                break;
+        }
+        case DHCP_OPTION_DATA_IPV4ADDRESS: {
+                r = in_addr_from_string(AF_INET, p, &addr);
+                if (r < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, r,
+                                   "Failed to parse DHCPv4 ipv4address data, ignoring assignment: %s", p);
+                        return 0;
+                }
+
+                udata = &addr.in;
+                sz = sizeof(addr.in.s_addr);
+                break;
+        }
+        case DHCP_OPTION_DATA_STRING:
+                sz = cunescape(p, 0, &q);
+                if (sz < 0) {
+                        log_syntax(unit, LOG_ERR, filename, line, sz,
+                                   "Failed to decode DHCPv4 option data, ignoring assignment: %s", p);
+                }
+
+                udata = q;
+                break;
+        default:
+                return -EINVAL;
+        }
+
+        r = sd_dhcp_option_new(u, udata, sz, &opt);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Failed to store DHCPv4 option '%s', ignoring assignment: %m", rvalue);
+                return 0;
+        }
+
+        r = ordered_hashmap_ensure_allocated(options, &dhcp_option_hash_ops);
+        if (r < 0)
+                return log_oom();
+
+        /* Overwrite existing option */
+        old = ordered_hashmap_remove(*options, UINT_TO_PTR(u));
+        r = ordered_hashmap_put(*options, UINT_TO_PTR(u), opt);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Failed to store DHCPv4 option '%s', ignoring assignment: %m", rvalue);
+                return 0;
+        }
+
+        TAKE_PTR(opt);
+        return 0;
+}
+
 DEFINE_CONFIG_PARSE_ENUM(config_parse_dhcp_use_domains, dhcp_use_domains, DHCPUseDomains,
                          "Failed to parse DHCP use domains setting");
 
index b194e0bfb785c743e6eb96111f1a35214e010faf..1d6ddbb8cc0b07c6775d5178adb5dd896f22b86e 100644 (file)
@@ -48,3 +48,4 @@ CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_use_sip);
 CONFIG_PARSER_PROTOTYPE(config_parse_iaid);
 CONFIG_PARSER_PROTOTYPE(config_parse_section_route_table);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_pd_hint);
+CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_send_option);
index a58cf8de8a3fce956716cc55d336716cda622a4d..98bb647bd7ab490e3ffc277a0d71670e01c3ce51 100644 (file)
@@ -2,8 +2,6 @@
 
 #include "sd-dhcp-server.h"
 
-#include "dhcp-internal.h"
-#include "escape.h"
 #include "networkd-dhcp-server.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
@@ -306,7 +304,7 @@ int dhcp4_server_configure(Link *link) {
                         return r;
         }
 
-        ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_options, i) {
+        ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_send_options, i) {
                 r = sd_dhcp_server_add_option(link->dhcp_server, p);
                 if (r == -EEXIST)
                         continue;
@@ -480,167 +478,3 @@ int config_parse_dhcp_server_sip(
                 n->dhcp_server_sip = m;
         }
 }
-
-int config_parse_dhcp_server_option_data(
-                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) {
-
-        _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt = NULL, *old = NULL;
-        _cleanup_free_ char *word = NULL, *q = NULL;
-        union in_addr_union addr;
-        DHCPOptionDataType type;
-        Network *network = data;
-        uint16_t uint16_data;
-        uint32_t uint32_data;
-        uint8_t uint8_data;
-        const char *p;
-        void *udata;
-        ssize_t sz;
-        uint8_t u;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        if (isempty(rvalue)) {
-                network->dhcp_server_options = ordered_hashmap_free(network->dhcp_server_options);
-                return 0;
-        }
-
-        p = rvalue;
-        r = extract_first_word(&p, &word, ":", 0);
-        if (r == -ENOMEM)
-                return log_oom();
-        if (r <= 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Invalid DHCP server send raw option, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        r = safe_atou8(word, &u);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Failed to parse  DHCP server send raw option type, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-        if (u < 1 || u >= 255) {
-                log_syntax(unit, LOG_ERR, filename, line, 0,
-                           "Invalid DHCP server send raw option, valid range is 1-254, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        free(word);
-
-        r = extract_first_word(&p, &word, ":", 0);
-        if (r == -ENOMEM)
-                return log_oom();
-        if (r <= 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Invalid DHCP server send raw option, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        type = dhcp_option_data_type_from_string(word);
-        if (type < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, 0,
-                           "Invalid DHCP server send data type, ignoring assignment: %s", p);
-                return 0;
-        }
-
-        switch(type) {
-        case DHCP_OPTION_DATA_UINT8:{
-                r = safe_atou8(p, &uint8_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 vendor specific uint8 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint8_data;
-                sz = sizeof(uint8_t);
-                break;
-        }
-        case DHCP_OPTION_DATA_UINT16:{
-                r = safe_atou16(p, &uint16_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 vendor specific uint16 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint16_data;
-                sz = sizeof(uint16_t);
-                break;
-        }
-        case DHCP_OPTION_DATA_UINT32: {
-                r = safe_atou32(p, &uint32_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 vendor specific uint32 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint32_data;
-                sz = sizeof(uint32_t);
-
-                break;
-        }
-        case DHCP_OPTION_DATA_IPV4ADDRESS: {
-                r = in_addr_from_string(AF_INET, p, &addr);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 vendor specific ipv4address data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &addr.in;
-                sz = sizeof(addr.in.s_addr);
-                break;
-        }
-        case DHCP_OPTION_DATA_STRING:
-                sz = cunescape(p, 0, &q);
-                if (sz < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, sz,
-                                   "Failed to decode option data, ignoring assignment: %s", p);
-                }
-
-                udata = q;
-                break;
-        default:
-                return -EINVAL;
-        }
-
-        r = sd_dhcp_option_new(u, udata, sz, &opt);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Failed to store DHCP send raw option '%s', ignoring assignment: %m", rvalue);
-                return 0;
-        }
-
-        r = ordered_hashmap_ensure_allocated(&network->dhcp_server_options, &dhcp_option_hash_ops);
-        if (r < 0)
-                return log_oom();
-
-        /* Overwrite existing option */
-        old = ordered_hashmap_remove(network->dhcp_server_options, UINT_TO_PTR(u));
-        r = ordered_hashmap_put(network->dhcp_server_options, UINT_TO_PTR(u), opt);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Failed to store DHCP server send raw option '%s'", rvalue);
-                return 0;
-        }
-
-        TAKE_PTR(opt);
-
-        return 0;
-}
index 21f1f31b157344a48bbb13013d3fe8d743788e36..c90d48ec002bb2104a33e91300f8607921afe7a1 100644 (file)
@@ -12,4 +12,3 @@ int dhcp4_server_configure(Link *link);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_dns);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_ntp);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_sip);
-CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_option_data);
index 7504e4eb2782546d6e4f7721ff49993a87fc1408..8ca87d99d4db7922569daf136814d9e4a2635222 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "alloc-util.h"
 #include "dhcp-client-internal.h"
-#include "escape.h"
 #include "hostname-util.h"
 #include "parse-util.h"
 #include "network-internal.h"
@@ -1295,7 +1294,7 @@ int dhcp4_configure(Link *link) {
                         return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for '%u': %m", option);
         }
 
-        ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_send_options, i) {
+        ORDERED_HASHMAP_FOREACH(send_option, link->network->dhcp_client_send_options, i) {
                 r = sd_dhcp_client_set_dhcp_option(link->dhcp_client, send_option);
                 if (r < 0)
                         return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set send option: %m");
@@ -1566,167 +1565,6 @@ int config_parse_dhcp_request_options(
         return 0;
 }
 
-int config_parse_dhcp_send_option(
-                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) {
-
-        _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt = NULL, *old = NULL;
-        _cleanup_free_ char *word = NULL, *q = NULL;
-        union in_addr_union addr;
-        DHCPOptionDataType type;
-        Network *network = data;
-        uint8_t u, uint8_data;
-        uint16_t uint16_data;
-        uint32_t uint32_data;
-        const char *p;
-        void *udata;
-        ssize_t sz;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        if (isempty(rvalue)) {
-                network->dhcp_send_options = ordered_hashmap_free(network->dhcp_send_options);
-                return 0;
-        }
-
-        p = rvalue;
-        r = extract_first_word(&p, &word, ":", 0);
-        if (r == -ENOMEM)
-                return log_oom();
-        if (r <= 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Invalid DHCP send option, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        r = safe_atou8(word, &u);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Invalid DHCP send option, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-        if (u < 1 || u >= 255) {
-                log_syntax(unit, LOG_ERR, filename, line, 0,
-                           "Invalid DHCP send option, valid range is 1-254, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        free(word);
-        r = extract_first_word(&p, &word, ":", 0);
-        if (r == -ENOMEM)
-                return log_oom();
-        if (r <= 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Invalid DHCP send option, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        type = dhcp_option_data_type_from_string(word);
-        if (type < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, 0,
-                           "Invalid DHCP send data type, ignoring assignment: %s", p);
-                return 0;
-        }
-
-        switch(type) {
-        case DHCP_OPTION_DATA_UINT8:{
-                r = safe_atou8(p, &uint8_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 uint8 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint8_data;
-                sz = sizeof(uint8_t);
-                break;
-        }
-        case DHCP_OPTION_DATA_UINT16:{
-                r = safe_atou16(p, &uint16_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 uint16 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint16_data;
-                sz = sizeof(uint16_t);
-                break;
-        }
-        case DHCP_OPTION_DATA_UINT32: {
-                r = safe_atou32(p, &uint32_data);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 uint32 data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &uint32_data;
-                sz = sizeof(uint32_t);
-
-                break;
-        }
-        case DHCP_OPTION_DATA_IPV4ADDRESS: {
-                r = in_addr_from_string(AF_INET, p, &addr);
-                if (r < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, r,
-                                   "Failed to parse DHCPv4 ipv4address data, ignoring assignment: %s", p);
-                        return 0;
-                }
-
-                udata = &addr.in;
-                sz = sizeof(addr.in.s_addr);
-                break;
-        }
-        case DHCP_OPTION_DATA_STRING:
-                sz = cunescape(p, 0, &q);
-                if (sz < 0) {
-                        log_syntax(unit, LOG_ERR, filename, line, sz,
-                                   "Failed to decode option data, ignoring assignment: %s", p);
-                }
-
-                udata = q;
-                break;
-        default:
-                return -EINVAL;
-        }
-
-        r = sd_dhcp_option_new(u, udata, sz, &opt);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Failed to store DHCP send option '%s', ignoring assignment: %m", rvalue);
-                return 0;
-        }
-
-        r = ordered_hashmap_ensure_allocated(&network->dhcp_send_options, &dhcp_option_hash_ops);
-        if (r < 0)
-                return log_oom();
-
-        /* Overwrite existing option */
-        old = ordered_hashmap_remove(network->dhcp_send_options, UINT_TO_PTR(u));
-        r = ordered_hashmap_put(network->dhcp_send_options, UINT_TO_PTR(u), opt);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, r,
-                           "Failed to store DHCP send option '%s'", rvalue);
-                return 0;
-        }
-
-        TAKE_PTR(opt);
-        return 0;
-}
-
 static const char* const dhcp_client_identifier_table[_DHCP_CLIENT_ID_MAX] = {
         [DHCP_CLIENT_ID_MAC] = "mac",
         [DHCP_CLIENT_ID_DUID] = "duid",
index 2c0ccd80dfb7338992411cab9c3140a5cf2a84ed..fce11ef671e65783c454a9c6cb83639936678bdd 100644 (file)
@@ -27,4 +27,3 @@ CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_black_listed_ip_address);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_max_attempts);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_user_class);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_request_options);
-CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_send_option);
index 928253cae0cd7de955b64712c38e462cc1dca132..f314b1ec16ef09d34b9a9b7ade7faa5d2a4a1b10 100644 (file)
@@ -175,7 +175,7 @@ DHCPv4.ListenPort,                      config_parse_uint16,
 DHCPv4.SendRelease,                     config_parse_bool,                               0,                             offsetof(Network, dhcp_send_release)
 DHCPv4.BlackList,                       config_parse_dhcp_black_listed_ip_address,       0,                             0
 DHCPv4.IPServiceType,                   config_parse_ip_service_type,                    0,                             offsetof(Network, ip_service_type)
-DHCPv4.SendOption,                      config_parse_dhcp_send_option,                   0,                             0
+DHCPv4.SendOption,                      config_parse_dhcp_send_option,                   0,                             offsetof(Network, dhcp_client_send_options)
 DHCPv6.UseDNS,                          config_parse_bool,                               0,                             offsetof(Network, dhcp6_use_dns)
 DHCPv6.UseNTP,                          config_parse_bool,                               0,                             offsetof(Network, dhcp6_use_ntp)
 DHCPv6.RapidCommit,                     config_parse_bool,                               0,                             offsetof(Network, rapid_commit)
@@ -200,7 +200,7 @@ DHCPServer.EmitTimezone,                config_parse_bool,
 DHCPServer.Timezone,                    config_parse_timezone,                           0,                             offsetof(Network, dhcp_server_timezone)
 DHCPServer.PoolOffset,                  config_parse_uint32,                             0,                             offsetof(Network, dhcp_server_pool_offset)
 DHCPServer.PoolSize,                    config_parse_uint32,                             0,                             offsetof(Network, dhcp_server_pool_size)
-DHCPServer.SendOption,                  config_parse_dhcp_server_option_data,            0,                             0
+DHCPServer.SendOption,                  config_parse_dhcp_send_option,                   0,                             offsetof(Network, dhcp_server_send_options)
 Bridge.Cost,                            config_parse_uint32,                             0,                             offsetof(Network, cost)
 Bridge.UseBPDU,                         config_parse_tristate,                           0,                             offsetof(Network, use_bpdu)
 Bridge.HairPin,                         config_parse_tristate,                           0,                             offsetof(Network, hairpin)
index 6b51b16d9bb17d80038e82bd9005308b834dd3c7..6e443975f1716da7a59402d1a0e64669fb92d83d 100644 (file)
@@ -686,8 +686,8 @@ static Network *network_free(Network *network) {
 
         set_free_free(network->dnssec_negative_trust_anchors);
 
-        ordered_hashmap_free(network->dhcp_send_options);
-        ordered_hashmap_free(network->dhcp_server_options);
+        ordered_hashmap_free(network->dhcp_client_send_options);
+        ordered_hashmap_free(network->dhcp_server_send_options);
 
         return mfree(network);
 }
index a1032051f10c880023c9b1d63e458213cf846fea..aa74bb4ae75a545b9ffefd49dd34c6e87f7df506 100644 (file)
@@ -114,8 +114,8 @@ struct Network {
         DHCPUseDomains dhcp_use_domains;
         Set *dhcp_black_listed_ip;
         Set *dhcp_request_options;
-        OrderedHashmap *dhcp_send_options;
-        OrderedHashmap *dhcp_server_options;
+        OrderedHashmap *dhcp_client_send_options;
+        OrderedHashmap *dhcp_server_send_options;
 
         /* DHCPv6 Client support*/
         bool dhcp6_use_dns;