diff options
Diffstat (limited to 'meta-extras/packages/networkmanager/files/allow-disabling.patch')
| -rw-r--r-- | meta-extras/packages/networkmanager/files/allow-disabling.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-extras/packages/networkmanager/files/allow-disabling.patch b/meta-extras/packages/networkmanager/files/allow-disabling.patch new file mode 100644 index 0000000000..10730e9fe5 --- /dev/null +++ b/meta-extras/packages/networkmanager/files/allow-disabling.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | Allow interfaces to be ignored by networkmanager by creation of a | ||
| 2 | /etc/network/nm-disabled-INTERFACENAME file. | ||
| 3 | |||
| 4 | RP - 16/7/2008 | ||
| 5 | |||
| 6 | Index: 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 | |||
