diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-01-19 17:25:26 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-02-20 23:23:02 +0100 |
commit | 4e82a9febdcedec8e1f65b10ef7da983affb5631 (patch) | |
tree | 5334b92acae763e4602236fdd8649e37676fc1ae | |
parent | 143a66022a240e6ddb77f5c02c8f71a3288e002d (diff) | |
download | NetworkManager-4e82a9febdcedec8e1f65b10ef7da983affb5631.tar.gz |
ifcfg-rh: add support for 802-1x.auth-timeout property
-rw-r--r-- | libnm-core/nm-setting-8021x.c | 7 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 7 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c index 869182feb6..840fcad460 100644 --- a/libnm-core/nm-setting-8021x.c +++ b/libnm-core/nm-setting-8021x.c @@ -4799,6 +4799,13 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * * Since: 1.8 **/ + /* ---ifcfg-rh--- + * property: auth-timeout + * variable: IEEE_8021X_AUTH_TIMEOUT(+) + * default: 0 + * description: Timeout in seconds for the 802.1X authentication. Zero means the global default or 25. + * ---end--- + */ g_object_class_install_property (object_class, PROP_AUTH_TIMEOUT, g_param_spec_int (NM_SETTING_802_1X_AUTH_TIMEOUT, "", "", diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 8372d536a3..0c1a238d6e 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -3081,6 +3081,7 @@ fill_8021x (shvarFile *ifcfg, shvarFile *keys = NULL; char *value; char **list = NULL, **iter; + gint64 timeout; value = svGetValueString (ifcfg, "IEEE_8021X_EAP_METHODS"); if (!value) { @@ -3181,6 +3182,9 @@ fill_8021x (shvarFile *ifcfg, g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH, value, NULL); g_free (value); + timeout = svGetValueInt64 (ifcfg, "IEEE_8021X_AUTH_TIMEOUT", 10, 0, G_MAXINT32, 0); + g_object_set (s_8021x, NM_SETTING_802_1X_AUTH_TIMEOUT, (gint32) timeout, NULL); + if (list) g_strfreev (list); if (keys) diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 57fb700b4f..f32bef2526 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -366,6 +366,7 @@ write_8021x_setting (NMConnection *connection, GString *phase2_auth; GString *str; guint32 i, num; + gint timeout; s_8021x = nm_connection_get_setting_802_1x (connection); if (!s_8021x) { @@ -504,6 +505,12 @@ write_8021x_setting (NMConnection *connection, svSetValueString (ifcfg, "IEEE_8021X_PHASE2_DOMAIN_SUFFIX_MATCH", nm_setting_802_1x_get_phase2_domain_suffix_match (s_8021x)); + timeout = nm_setting_802_1x_get_auth_timeout (s_8021x); + if (timeout > 0) + svSetValueInt64 (ifcfg, "IEEE_8021X_AUTH_TIMEOUT", timeout); + else + svUnsetValue (ifcfg, "IEEE_8021X_AUTH_TIMEOUT"); + success = write_8021x_certs (s_8021x, FALSE, ifcfg, error); if (success) { /* phase2/inner certs */ |