diff options
Diffstat (limited to 'src/vpn/nm-vpn-connection.c')
| -rw-r--r-- | src/vpn/nm-vpn-connection.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c index bd847d75..91acf07e 100644 --- a/src/vpn/nm-vpn-connection.c +++ b/src/vpn/nm-vpn-connection.c @@ -193,7 +193,7 @@ static void _set_vpn_state (NMVpnConnection *self, #define __NMLOG_prefix_buf_len 128 static const char * -__LOG_create_prefix (char *buf, NMVpnConnection *self, NMSettingsConnection *con) +__LOG_create_prefix (char *buf, NMVpnConnection *self, NMConnection *con) { NMVpnConnectionPrivate *priv; const char *id; @@ -202,7 +202,7 @@ __LOG_create_prefix (char *buf, NMVpnConnection *self, NMSettingsConnection *con return _NMLOG_PREFIX_NAME; priv = NM_VPN_CONNECTION_GET_PRIVATE (self); - id = con ? nm_settings_connection_get_id (con) : NULL; + id = con ? nm_connection_get_id (con) : NULL; g_snprintf (buf, __NMLOG_prefix_buf_len, "%s[" @@ -214,7 +214,7 @@ __LOG_create_prefix (char *buf, NMVpnConnection *self, NMSettingsConnection *con "]", _NMLOG_PREFIX_NAME, self, - con ? "," : "--", con ? (nm_settings_connection_get_uuid (con) ?: "??") : "", + con ? "," : "--", con ? (nm_connection_get_uuid (con) ?: "??") : "", con ? "," : "", NM_PRINT_FMT_QUOTED (id, "\"", id, "\"", con ? "??" : ""), priv->ip_ifindex, NM_PRINT_FMT_QUOTED (priv->ip_iface, ":(", priv->ip_iface, ")", "") @@ -225,17 +225,17 @@ __LOG_create_prefix (char *buf, NMVpnConnection *self, NMSettingsConnection *con #define _NMLOG(level, ...) \ G_STMT_START { \ - const NMLogLevel _level = (level); \ - NMSettingsConnection *_con = (self) ? _get_settings_connection (self, TRUE) : NULL; \ + const NMLogLevel __level = (level); \ + NMConnection *__con = (self) ? (NMConnection *) _get_settings_connection (self, TRUE) : NULL; \ \ - if (nm_logging_enabled (_level, _NMLOG_DOMAIN)) { \ + if (nm_logging_enabled (__level, _NMLOG_DOMAIN)) { \ char __prefix[__NMLOG_prefix_buf_len]; \ \ - _nm_log (_level, _NMLOG_DOMAIN, 0, \ + _nm_log (__level, _NMLOG_DOMAIN, 0, \ (self) ? NM_VPN_CONNECTION_GET_PRIVATE (self)->ip_iface : NULL, \ - (_con) ? nm_settings_connection_get_uuid (_con) : NULL, \ + (__con) ? nm_connection_get_uuid (__con) : NULL, \ "%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \ - __LOG_create_prefix (__prefix, (self), _con) \ + __LOG_create_prefix (__prefix, (self), __con) \ _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ } \ } G_STMT_END @@ -1619,7 +1619,6 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) nm_ip4_config_merge_setting (config, s_ip, nm_setting_connection_get_mdns (s_con), - nm_setting_connection_get_llmnr (s_con), route_table, route_metric); @@ -1877,10 +1876,13 @@ connect_success (NMVpnConnection *self) * It is a configured value or 60 seconds */ timeout = nm_setting_vpn_get_timeout (s_vpn); if (timeout == 0) { - timeout = nm_config_data_get_connection_default_int64 (NM_CONFIG_GET_DATA, - "vpn.timeout", - NULL, - 1, G_MAXUINT32, 60); + char *value; + + value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, + "vpn.timeout", NULL); + timeout = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, 60); + timeout = timeout == 0 ? 60 : timeout; + g_free (value); } priv->connect_timeout = g_timeout_add_seconds (timeout, connect_timeout_cb, self); |