ifcfg-rh: add support for connection.dns-over-tls

This commit is contained in:
Robin Ebert 2021-10-03 14:14:36 +02:00
parent 879e4f3546
commit b652202829
No known key found for this signature in database
GPG key ID: 8B6531570DC10850
5 changed files with 28 additions and 1 deletions

View file

@ -634,6 +634,15 @@ make_connection_setting(const char *file,
PARSE_WARNING("invalid LLMNR setting");
g_object_set(s_con, NM_SETTING_CONNECTION_LLMNR, i_val, NULL);
i_val = NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT;
if (!svGetValueEnum(ifcfg,
"DNS_OVER_TLS",
nm_setting_connection_dns_over_tls_get_type(),
&i_val,
NULL))
PARSE_WARNING("invalid DNS_OVER_TLS setting");
g_object_set(s_con, NM_SETTING_CONNECTION_DNS_OVER_TLS, i_val, NULL);
return NM_SETTING(s_con);
}

View file

@ -892,6 +892,7 @@ const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[] = {
_KEY_TYPE("DHCPv6_DUID", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("DHCPv6_IAID", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("DNS", NMS_IFCFG_KEY_TYPE_IS_NUMBERED),
_KEY_TYPE("DNS_OVER_TLS", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("DOMAIN", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("ESSID", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("ETHTOOL_OPTS", NMS_IFCFG_KEY_TYPE_IS_PLAIN),

View file

@ -33,7 +33,7 @@ typedef struct {
NMSIfcfgKeyTypeFlags key_flags;
} NMSIfcfgKeyTypeInfo;
extern const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[252];
extern const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[253];
const NMSIfcfgKeyTypeInfo *nms_ifcfg_well_known_key_find_info(const char *key, gssize *out_idx);

View file

@ -2087,6 +2087,7 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg)
gint32 vint32;
NMSettingConnectionMdns mdns;
NMSettingConnectionLlmnr llmnr;
NMSettingConnectionDnsOverTls dns_over_tls;
guint32 vuint32;
const char * tmp, *mud_url;
@ -2270,6 +2271,14 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg)
if (llmnr != NM_SETTING_CONNECTION_LLMNR_DEFAULT) {
svSetValueEnum(ifcfg, "LLMNR", nm_setting_connection_llmnr_get_type(), llmnr);
}
dns_over_tls = nm_setting_connection_get_dns_over_tls(s_con);
if (dns_over_tls != NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT) {
svSetValueEnum(ifcfg,
"DNS_OVER_TLS",
nm_setting_connection_dns_over_tls_get_type(),
dns_over_tls);
}
}
static char *

View file

@ -2596,6 +2596,14 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
*
* Since: 1.34
**/
/* ---ifcfg-rh---
* property: dns-over-tls
* variable: DNS_OVER_TLS(+)
* values: yes,no,opportunistic
* default: missing variable means global default
* description: Whether or not DNSOverTls is enabled for the connection
* ---end---
*/
_nm_setting_property_define_direct_int32(properties_override,
obj_properties,
NM_SETTING_CONNECTION_DNS_OVER_TLS,