[PATCH] add an ip6_manager object for the IPv6 Manual setting case



This is so the routes added in this case can be torn down by
...flush_routes() in nm_device_deactivate(). Without an ip6_manager
object, only the IPv4 routes are considered (AF_INET is passed for
family instead of AF_UNSPEC).

See the attached file.

Regards,

Mathieu Trudel-Lapierre <mathieu tl gmail com>
Freenode: cyphermox, Jabber: mathieu tl gmail com
4096R/EE018C93 1967 8F7D 03A1 8F38 732E  FF82 C126 33E1 EE01 8C93
From 86cd23c80354b7e563155f03f1147138f9c44e19 Mon Sep 17 00:00:00 2001
From: Mathieu Trudel-Lapierre <mathieu trudel-lapierre canonical com>
Date: Fri, 7 Oct 2011 16:46:28 -0400
Subject: [PATCH] ip6: add an unused ip6_manager for Manual IPv6 settings so
 routes are torn down

---
 src/nm-device.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/nm-device.c b/src/nm-device.c
index 559606c..1afd859 100644
--- a/src/nm-device.c
+++ b/src/nm-device.c
@@ -1769,6 +1769,10 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason)
 		priv->ip6_ready = TRUE;
 		ret = NM_ACT_STAGE_RETURN_STOP;
 	} else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+		/* Make sure there is an (unused) ip6_manager set, so we still
+		 * try to remove routes once the device is deactivated */
+		priv->ip6_manager = nm_ip6_manager_get ();
+
 		/* Router advertisements shouldn't be used in manual mode */
 		if (priv->ip6_accept_ra_path)
 			nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n");
-- 
1.7.5.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]