mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 00:00:08 +01:00
vpn-connection: don't fail the connection if there's no VPN gateway
The stongswan charon_nm plugin doesn't send a gateway. The logic was accidentally broken with GDBus port. Fixes:231b0390a5(cherry picked from commitdd0e070844)
This commit is contained in:
parent
066fab71b6
commit
d40539acaf
1 changed files with 6 additions and 8 deletions
|
|
@ -1210,7 +1210,7 @@ process_generic_config (NMVpnConnection *self, GVariant *dict)
|
|||
const char *str;
|
||||
GVariant *v;
|
||||
guint32 u32;
|
||||
gboolean b, success = FALSE;
|
||||
gboolean b;
|
||||
|
||||
if (g_variant_lookup (dict, NM_VPN_PLUGIN_CAN_PERSIST, "b", &b) && b) {
|
||||
/* Defaults to FALSE, so only let service indicate TRUE */
|
||||
|
|
@ -1246,17 +1246,15 @@ process_generic_config (NMVpnConnection *self, GVariant *dict)
|
|||
|
||||
if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "u", &u32)) {
|
||||
priv->ip4_external_gw = u32;
|
||||
success = TRUE;
|
||||
} else if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "@ay", &v)) {
|
||||
priv->ip6_external_gw = ip6_addr_dup_from_variant (v);
|
||||
success = !!priv->ip6_external_gw;
|
||||
g_variant_unref (v);
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
_LOGE ("VPN gateway is neither IPv4 nor IPv6");
|
||||
nm_vpn_connection_config_maybe_complete (self, FALSE);
|
||||
return FALSE;
|
||||
if (!priv->ip6_external_gw) {
|
||||
_LOGE ("Invalid IPv6 VPN gateway address received");
|
||||
nm_vpn_connection_config_maybe_complete (self, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
priv->mtu = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue