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

Re: [SRM] update for network-manager in 6.0.1



Am 11.03.2011 13:24, schrieb Philipp Kern:
> Hi,
> 
> are all those patches already applied in unstable?  I do assume this now
> and the ACKs are dependent on that.
>
FWIW, the attached patch is the one I intended to upload given the feedback so far.

Cheers,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/debian/changelog b/debian/changelog
index 46daaec..3d344b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+network-manager (0.8.1-6+squeeze1) stable; urgency=low
+
+  * debian/patches/82-core-handle-device-removal.patch
+    - Cherry-pick patch from upstream to correctly handle device removal when
+      properties are unreadable. (Closes: #605570)
+  * debian/patches/83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch
+    - Newer versions of dnsmasq validate the option parameters more strictly.
+      Instead of passing a bogus file name simply use --conf-file without
+      additional parameters. (Closes: #615082)
+  * debian/ifblacklist_migrate.sh
+    - Only comment out iface lines if we have an exact match for the network
+      interface. (Closes: #612247)
+  * debian/patches/51-normalized-keys.patch
+    - Normalize keys in ifupdown parser, so we accept options with either
+      hyphens or underscores, like e.g. bridge_ports and bridge-ports.
+      (Closes: #609831)
+
+ -- Michael Biebl <biebl@debian.org>  Fri, 11 Mar 2011 14:49:51 +0100
+
 network-manager (0.8.1-6) unstable; urgency=low
 
   * debian/patches/40-umanaged-interfaces.patch
diff --git a/debian/ifblacklist_migrate.sh b/debian/ifblacklist_migrate.sh
index 1d41266..c30971c 100644
--- a/debian/ifblacklist_migrate.sh
+++ b/debian/ifblacklist_migrate.sh
@@ -41,7 +41,7 @@ for i in $auto_ifs; do
       if test x$nulled_line != x; then
 	  line_count=$(expr $line_count + 1)
       fi
-  done  
+  done
 
   if test $line_count -eq 0 -a $word_count -gt 0; then
      ifaces_to_disable="$ifaces_to_disable $i"
@@ -59,7 +59,7 @@ if [ -n "$ifaces_to_disable" ]; then
     cp $NIF_FILE "$NIF_FILE.bak-${backup_suffix}"
     for i in $ifaces_to_disable; do
 	echo -n "Disabling interface: $i ... "
-	sed -i -e "s/^\([ \t]*iface.*$i.*\)$/#NetworkManager#\1/" $NIF_FILE
+	sed -i -e "s/^\([ \t]*iface.*[ \t]$i[ \t].*\)$/#NetworkManager#\1/" $NIF_FILE
 	echo done.
     done
 fi
diff --git a/debian/patches/50-bridge-interfaces.patch b/debian/patches/50-bridge-interfaces.patch
index f58ba5d..de243fb 100644
--- a/debian/patches/50-bridge-interfaces.patch
+++ b/debian/patches/50-bridge-interfaces.patch
@@ -1,8 +1,8 @@
 Index: network-manager/system-settings/plugins/ifupdown/plugin.c
 ===================================================================
---- network-manager.orig/system-settings/plugins/ifupdown/plugin.c	2010-12-04 16:41:38.000000000 +0100
-+++ network-manager/system-settings/plugins/ifupdown/plugin.c	2010-12-04 16:51:51.810906877 +0100
-@@ -360,9 +360,49 @@
+--- network-manager.orig/system-settings/plugins/ifupdown/plugin.c	2011-03-11 14:47:00.272832466 +0100
++++ network-manager/system-settings/plugins/ifupdown/plugin.c	2011-03-11 14:47:01.272832466 +0100
+@@ -360,9 +360,51 @@
  	while (block) {
  		if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type))
  			g_hash_table_insert (auto_ifaces, block->name, GUINT_TO_POINTER (1));
@@ -15,11 +15,13 @@ Index: network-manager/system-settings/plugins/ifupdown/plugin.c
 +				/* Try to find bridge ports */
 +				const char *ports = ifparser_getkey (block, "bridge_ports");
 +				if (ports) {
-+					PLUGIN_PRINT("SCPlugin-Ifupdown", "found bridge ports %s for %s", ports, block->name);
-+					char **port_ifaces = g_strsplit_set (ports, " \t", -1);
-+
 +					int i;
 +					int state = 0;
++					char **port_ifaces;
++
++					PLUGIN_PRINT("SCPlugin-Ifupdown", "found bridge ports %s for %s", ports, block->name);
++
++					port_ifaces = g_strsplit_set (ports, " \t", -1);
 +					for (i = 0; i < g_strv_length (port_ifaces); i++) {
 +						char *token = port_ifaces[i];
 +						/* Skip crazy stuff like regex or all */
@@ -53,7 +55,7 @@ Index: network-manager/system-settings/plugins/ifupdown/plugin.c
  			/* Remove any connection for this block that was previously found */
  			exported = g_hash_table_lookup (priv->iface_connections, block->name);
  			if (exported) {
-@@ -385,6 +425,7 @@
+@@ -385,6 +427,7 @@
  			g_hash_table_insert (priv->well_known_interfaces, block->name, "known");
  			PLUGIN_PRINT("SCPlugin-Ifupdown", "adding mapping %s to well_known_interfaces", block->name);
  		}
diff --git a/debian/patches/51-normalized-keys.patch b/debian/patches/51-normalized-keys.patch
new file mode 100644
index 0000000..750eb13
--- /dev/null
+++ b/debian/patches/51-normalized-keys.patch
@@ -0,0 +1,37 @@
+Index: network-manager/system-settings/plugins/ifupdown/interface_parser.c
+===================================================================
+--- network-manager.orig/system-settings/plugins/ifupdown/interface_parser.c	2011-03-11 14:38:52.996832466 +0100
++++ network-manager/system-settings/plugins/ifupdown/interface_parser.c	2011-03-11 14:47:12.580832465 +0100
+@@ -51,6 +51,7 @@
+ void add_data(const char *key,const char *data)
+ {
+ 	if_data *ret;
++	char *idx;
+ 
+ 	// Check if there is a block where we can attach our data
+ 	if (first == NULL)
+@@ -58,6 +59,11 @@
+ 
+ 	ret = (if_data*) calloc(1,sizeof(struct _if_data));
+ 	ret->key = g_strdup(key);
++	// Normalize keys. Convert '_' to '-', as ifupdown accepts both variants.
++	// When querying keys via ifparser_getkey(), use '-'.
++	while ((idx = strrchr(ret->key, '_'))) {
++		*idx = '-';
++	}
+ 	ret->data = g_strdup(data);
+ 
+ 	if (last->info == NULL)
+Index: network-manager/system-settings/plugins/ifupdown/plugin.c
+===================================================================
+--- network-manager.orig/system-settings/plugins/ifupdown/plugin.c	2011-03-11 14:47:01.272832466 +0100
++++ network-manager/system-settings/plugins/ifupdown/plugin.c	2011-03-11 14:47:12.580832465 +0100
+@@ -366,7 +366,7 @@
+ 			/* Bridge configuration */
+ 			if(!strncmp ("br", block->name, 2)) {
+ 				/* Try to find bridge ports */
+-				const char *ports = ifparser_getkey (block, "bridge_ports");
++				const char *ports = ifparser_getkey (block, "bridge-ports");
+ 				if (ports) {
+ 					int i;
+ 					int state = 0;
diff --git a/debian/patches/82-core-handle-device-removal.patch b/debian/patches/82-core-handle-device-removal.patch
new file mode 100644
index 0000000..0e9ae6d
--- /dev/null
+++ b/debian/patches/82-core-handle-device-removal.patch
@@ -0,0 +1,34 @@
+From aff8f48190458c7dc894ad0ec07c935dc530abab Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw@redhat.com>
+Date: Tue, 23 Nov 2010 13:10:01 -0600
+Subject: [PATCH] core: handle device removal when properties are unreadable
+
+By the time we get the udev device removal notification we may not
+be able to read properties, since the device has already been
+removed from sysfs.  That means we can't get the ifindex, so we need
+to fall back to the interface name.  But we always want to prefer
+the ifindex since that will never change as long as the device is
+connected, unlike the interface name.
+---
+ src/nm-manager.c |    8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+Index: network-manager/src/nm-manager.c
+===================================================================
+--- network-manager.orig/src/nm-manager.c	2011-03-11 14:38:52.924832466 +0100
++++ network-manager/src/nm-manager.c	2011-03-11 14:49:20.272832466 +0100
+@@ -1842,6 +1842,14 @@
+ 
+ 	ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX");
+ 	device = find_device_by_ifindex (self, ifindex);
++	if (!device) {
++		/* On removal we won't always be able to read properties anymore, as
++		 * they may have already been removed from sysfs.  Instead, we just
++		 * have to fall back to the device's interface name.
++		 */
++		device = find_device_by_iface (self, g_udev_device_get_name (udev_device));
++	}
++
+ 	if (device)
+ 		priv->devices = remove_one_device (self, priv->devices, device, FALSE, TRUE);
+ }
diff --git a/debian/patches/83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch b/debian/patches/83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch
new file mode 100644
index 0000000..01a2e65
--- /dev/null
+++ b/debian/patches/83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch
@@ -0,0 +1,41 @@
+From 6bf63e913c8246345167f937963c2c14da59ee23 Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw@redhat.com>
+Date: Fri, 4 Mar 2011 23:52:44 -0600
+Subject: [PATCH] dnsmasq: send no config file instead of a bogus one (lp:725041) (debian #615082)
+
+---
+ src/dnsmasq-manager/nm-dnsmasq-manager.c |   12 ++----------
+ 1 files changed, 2 insertions(+), 10 deletions(-)
+
+Index: network-manager/src/dnsmasq-manager/nm-dnsmasq-manager.c
+===================================================================
+--- network-manager.orig/src/dnsmasq-manager/nm-dnsmasq-manager.c	2011-03-11 14:38:52.884832466 +0100
++++ network-manager/src/dnsmasq-manager/nm-dnsmasq-manager.c	2011-03-11 14:49:25.000832466 +0100
+@@ -253,7 +253,6 @@
+ 	struct in_addr addr;
+ 	char buf[INET_ADDRSTRLEN + 15];
+ 	char localaddr[INET_ADDRSTRLEN + 1];
+-	int i;
+ 
+ 	dm_binary = nm_find_dnsmasq ();
+ 	if (!dm_binary) {
+@@ -277,17 +276,10 @@
+ 	/* dnsmasq may read from it's default config file location, which if that
+ 	 * location is a valid config file, it will combine with the options here
+ 	 * and cause undesirable side-effects.  Like sending bogus IP addresses
+-	 * as the gateway or whatever.  So give dnsmasq a bogus config file
+-	 * location to avoid screwing up the configuration we're passing to it.
++	 * as the gateway or whatever.  So tell dnsmasq not to use any config file
++	 * at all.
+ 	 */
+-	memset (buf, 0, sizeof (buf));
+-	strcpy (buf, "/tmp/");
+-	for (i = 5; i < 15; i++)
+-		buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF);
+-	strcat (buf, ".conf");
+-
+ 	nm_cmd_line_add_string (cmd, "--conf-file");
+-	nm_cmd_line_add_string (cmd, buf);
+ 
+ 	nm_cmd_line_add_string (cmd, "--no-hosts");
+ 	nm_cmd_line_add_string (cmd, "--keep-in-foreground");
diff --git a/debian/patches/series b/debian/patches/series
index 012269a..610d86d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,6 @@
 30-typo_fix.patch
 40-umanaged-interfaces.patch
 50-bridge-interfaces.patch
+51-normalized-keys.patch
+82-core-handle-device-removal.patch
+83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: