summaryrefslogtreecommitdiffstats
path: root/meta/packages/networkmanager/files
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-07-16 08:35:51 +0000
committerRichard Purdie <richard@openedhand.com>2008-07-16 08:35:51 +0000
commit33d99387eb822c9133c244d1789122eb4787ccbc (patch)
tree74c7ef7c670499eac1f1c23f45d27d228781972b /meta/packages/networkmanager/files
parenta3d88b472b58128d667cd1b8ff2a5b5a955110c8 (diff)
downloadpoky-33d99387eb822c9133c244d1789122eb4787ccbc.tar.gz
networkmanager: Add a method to stop network manager controlling selected network interfaces
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4843 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/networkmanager/files')
-rw-r--r--meta/packages/networkmanager/files/allow-disabling.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/packages/networkmanager/files/allow-disabling.patch b/meta/packages/networkmanager/files/allow-disabling.patch
new file mode 100644
index 0000000000..10730e9fe5
--- /dev/null
+++ b/meta/packages/networkmanager/files/allow-disabling.patch
@@ -0,0 +1,45 @@
1Allow interfaces to be ignored by networkmanager by creation of a
2/etc/network/nm-disabled-INTERFACENAME file.
3
4RP - 16/7/2008
5
6Index: trunk/src/backends/NetworkManagerDebian.c
7===================================================================
8--- trunk.orig/src/backends/NetworkManagerDebian.c 2008-07-15 19:23:11.000000000 +0100
9+++ trunk/src/backends/NetworkManagerDebian.c 2008-07-15 19:37:05.000000000 +0100
10@@ -29,6 +29,7 @@
11
12 #include <stdio.h>
13 #include <sys/types.h>
14+#include <sys/stat.h>
15 #include <signal.h>
16 #include <arpa/inet.h>
17 #include "NetworkManagerGeneric.h"
18@@ -374,12 +375,25 @@
19 /*
20 * nm_system_device_get_disabled
21 *
22- * Return whether the distro-specific system config tells us to use
23- * dhcp for this device.
24+ * Return whether the distro-specific system config tells us to interact
25+ * with this device.
26 *
27 */
28 gboolean nm_system_device_get_disabled (NMDevice *dev)
29 {
30+ struct stat statbuf;
31+ gchar *filepath;
32+
33+ g_return_val_if_fail (dev != NULL, FALSE);
34+
35+ filepath = g_strdup_printf (SYSCONFDIR"/network/nm-disabled-%s", nm_device_get_iface (dev));
36+
37+ if (stat(filepath, &statbuf) == 0) {
38+ g_free(filepath);
39+ return TRUE;
40+ }
41+
42+ g_free(filepath);
43 return FALSE;
44 }
45