diff options
-rw-r--r-- | src/network/networkd-conf.c | 27 | ||||
-rw-r--r-- | src/network/networkd-conf.h | 1 | ||||
-rw-r--r-- | src/network/networkd-dhcp4.c | 28 | ||||
-rw-r--r-- | src/network/networkd-dhcp4.h | 1 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 2 |
5 files changed, 30 insertions, 29 deletions
diff --git a/src/network/networkd-conf.c b/src/network/networkd-conf.c index eef7788c49..350fea634c 100644 --- a/src/network/networkd-conf.c +++ b/src/network/networkd-conf.c @@ -182,30 +182,3 @@ int config_parse_duid_rawdata( ret->raw_data_len = count; return 0; } - -int config_parse_ip_service_type( - 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) { - - assert(filename); - assert(lvalue); - assert(rvalue); - - if (streq(rvalue, "CS4")) - *((int *)data) = IPTOS_CLASS_CS4; - else if (streq(rvalue, "CS6")) - *((int *)data) = IPTOS_CLASS_CS6; - else - log_syntax(unit, LOG_WARNING, filename, line, 0, - "Failed to parse IPServiceType type '%s', ignoring.", rvalue); - - return 0; -} diff --git a/src/network/networkd-conf.h b/src/network/networkd-conf.h index a615998f92..88a2c64031 100644 --- a/src/network/networkd-conf.h +++ b/src/network/networkd-conf.h @@ -15,4 +15,3 @@ const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TY CONFIG_PARSER_PROTOTYPE(config_parse_duid_type); CONFIG_PARSER_PROTOTYPE(config_parse_duid_rawdata); -CONFIG_PARSER_PROTOTYPE(config_parse_ip_service_type); diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 34770f6f2b..13e3e32f40 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include <netinet/in.h> +#include <netinet/ip.h> #include <linux/if.h> #include <linux/if_arp.h> @@ -1703,6 +1704,33 @@ int config_parse_dhcp_request_options( return 0; } +int config_parse_dhcp_ip_service_type( + 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) { + + assert(filename); + assert(lvalue); + assert(rvalue); + + if (streq(rvalue, "CS4")) + *((int *)data) = IPTOS_CLASS_CS4; + else if (streq(rvalue, "CS6")) + *((int *)data) = IPTOS_CLASS_CS6; + else + log_syntax(unit, LOG_WARNING, filename, line, 0, + "Failed to parse IPServiceType type '%s', ignoring.", rvalue); + + return 0; +} + static const char* const dhcp_client_identifier_table[_DHCP_CLIENT_ID_MAX] = { [DHCP_CLIENT_ID_MAC] = "mac", [DHCP_CLIENT_ID_DUID] = "duid", diff --git a/src/network/networkd-dhcp4.h b/src/network/networkd-dhcp4.h index fce11ef671..95fa5ee4b5 100644 --- a/src/network/networkd-dhcp4.h +++ b/src/network/networkd-dhcp4.h @@ -27,3 +27,4 @@ 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_ip_service_type); diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 134f1535d6..fb726c8634 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -180,7 +180,7 @@ DHCPv4.ListenPort, config_parse_uint16, DHCPv4.SendRelease, config_parse_bool, 0, offsetof(Network, dhcp_send_release) DHCPv4.SendDecline, config_parse_bool, 0, offsetof(Network, dhcp_send_decline) 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.IPServiceType, config_parse_dhcp_ip_service_type, 0, offsetof(Network, ip_service_type) DHCPv4.SendOption, config_parse_dhcp_send_option, 0, offsetof(Network, dhcp_client_send_options) DHCPv4.RouteMTUBytes, config_parse_mtu, AF_INET, offsetof(Network, dhcp_route_mtu) DHCPv6.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp6_use_dns) |