summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-27 20:28:04 +0200
committerThomas Haller <thaller@redhat.com>2020-04-28 09:44:43 +0200
commitd446c909858d188cba4f31ab0dbf240dd3fcaa20 (patch)
treef627e41e3a5f5eb176e6b31dde136da86bde4fbe
parent9f4ac106a28e5108bc1ec339a25d6a7ead99c50d (diff)
downloadNetworkManager-d446c909858d188cba4f31ab0dbf240dd3fcaa20.tar.gz
vpn: clear host part of IPv6 routes received from VPN plugin
Kernel would reject adding a route with a destination host part not all zero. NetworkManager generally coerces such routes and there are assertions in place to ensure that. We forgot to ensure that for certain IPv6 routes from VPN plugins. This can cause an assertion failure and wrong behavior. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/425 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/482 (cherry picked from commit b437bb4a6e8f4b1ca8678e8727b02b21d4cb7562) (cherry picked from commit c7586e63885e1de9b80b9dc94feceea0f3fe4bf2) (cherry picked from commit 55c361453bd43df92141870728a43bdbaab0ff6d) (cherry picked from commit 75933cd6fff6917f72cea4f85e6ccb913df78e88)
-rw-r--r--src/vpn/nm-vpn-connection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c
index 5acf491a2c..63e05d6a38 100644
--- a/src/vpn/nm-vpn-connection.c
+++ b/src/vpn/nm-vpn-connection.c
@@ -1807,6 +1807,8 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict)
route.metric = route_metric;
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
+ nm_utils_ip6_address_clear_host_address (&route.network, &route.network, route.plen);
+
/* 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