commit 444491490e654c11bb1f94c5e7db09763783c73a
parent eebd44cfc08641312d6fbfd66a4c4be86cb827a8
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date: Wed, 2 Oct 2019 13:39:57 -0700
netconfig: Remove IPv6 default route
The IPv6 default route needs to be explicitly revoked. Unlike in IPv4,
there is no SRC address associated with the route and it will not be
removed on address removal.
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/netconfig.c b/src/netconfig.c
@@ -958,6 +958,7 @@ static void netconfig_ipv6_select_and_install(struct netconfig *netconfig)
static void netconfig_ipv6_select_and_uninstall(struct netconfig *netconfig)
{
struct netconfig_ifaddr *ifaddr;
+ char *gateway;
ifaddr = netconfig_ipv6_get_ifaddr(netconfig,
netconfig->rtm_v6_protocol);
@@ -970,6 +971,20 @@ static void netconfig_ipv6_select_and_uninstall(struct netconfig *netconfig)
* TODO
* l_dhcp_v6_client_stop(netconfig->l_dhcp_v6_client);
*/
+
+ gateway = netconfig_ipv6_get_gateway(netconfig);
+ if (!gateway)
+ return;
+
+ if (!rtnl_route_ipv6_delete_gateway(rtnl, netconfig->ifindex,
+ gateway, ROUTE_PRIORITY_OFFSET,
+ netconfig->rtm_v6_protocol,
+ netconfig_route_cmd_cb, NULL, NULL)) {
+ l_error("netconfig: Failed to delete route for: %s gateway.",
+ gateway);
+ }
+
+ l_free(gateway);
}
bool netconfig_configure(struct netconfig *netconfig,