ifcfg-rh: add support for 802-1x.auth-timeout property

This commit is contained in:
Beniamino Galvani 2017-01-19 17:25:26 +01:00
parent 9a215d332b
commit 556a46959f
3 changed files with 18 additions and 0 deletions

View file

@ -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, "", "",

View file

@ -3087,6 +3087,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) {
@ -3187,6 +3188,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)

View file

@ -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 */