mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 06:10:11 +01:00
vpn: merge branch 'th/vpn-ipv6-addr-fix-assert'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/482
(cherry picked from commit d9dbe88427)
This commit is contained in:
commit
cfc79124ef
1 changed files with 26 additions and 14 deletions
|
|
@ -1595,13 +1595,18 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
|
|||
route.plen = plen;
|
||||
route.network = nm_utils_ip4_address_clear_host_address (route.network, plen);
|
||||
|
||||
/* Ignore host routes to the VPN gateway since NM adds one itself
|
||||
* below. Since NM knows more about the routing situation than
|
||||
* the VPN server, we want to use the NM created route instead of
|
||||
* whatever the server provides.
|
||||
*/
|
||||
if (!(priv->ip4_external_gw && route.network == priv->ip4_external_gw && route.plen == 32))
|
||||
nm_ip4_config_add_route (config, &route, NULL);
|
||||
if ( priv->ip4_external_gw
|
||||
&& route.network == priv->ip4_external_gw
|
||||
&& route.plen == 32) {
|
||||
/* Ignore host routes to the VPN gateway since NM adds one itself
|
||||
* below. Since NM knows more about the routing situation than
|
||||
* the VPN server, we want to use the NM created route instead of
|
||||
* whatever the server provides.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
nm_ip4_config_add_route (config, &route, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -1790,13 +1795,20 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict)
|
|||
route.metric = route_metric;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
|
||||
|
||||
/* Ignore host routes to the VPN gateway since NM adds one itself.
|
||||
* Since NM knows more about the routing situation than the VPN
|
||||
* server, we want to use the NM created route instead of whatever
|
||||
* the server provides.
|
||||
*/
|
||||
if (!(priv->ip6_external_gw && IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw) && route.plen == 128))
|
||||
nm_ip6_config_add_route (config, &route, NULL);
|
||||
nm_utils_ip6_address_clear_host_address (&route.network, &route.network, route.plen);
|
||||
|
||||
if ( priv->ip6_external_gw
|
||||
&& IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw)
|
||||
&& route.plen == 128) {
|
||||
/* Ignore host routes to the VPN gateway since NM adds one itself.
|
||||
* Since NM knows more about the routing situation than the VPN
|
||||
* server, we want to use the NM created route instead of whatever
|
||||
* the server provides.
|
||||
*/
|
||||
goto next;
|
||||
}
|
||||
|
||||
nm_ip6_config_add_route (config, &route, NULL);
|
||||
|
||||
next:
|
||||
g_variant_unref (dest);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue