diff options
| -rw-r--r-- | debian/changelog | 11 | ||||
| -rw-r--r-- | debian/patches/05-debian_backend.patch | 123 | ||||
| -rw-r--r-- | debian/patches/05-resolvconf.patch | 20 | ||||
| -rw-r--r-- | debian/patches/08-disabled_devices.patch | 52 |
4 files changed, 132 insertions, 74 deletions
diff --git a/debian/changelog b/debian/changelog index e653d562..4ca14491 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,19 @@ network-manager (0.6.4-1) unstable; urgency=low + [ Riccardo Setti ] * New upstream release. (Closes: #379163) - * Allow interfaces marked "auto-hotplug" to be managed by NM. + * Allow interfaces marked "auto-hotplug" to be managed by NM. (Closes: #381017) * Added 09_fix_bigendian_words.patch wich will fix the WPA+plaint text pw auth method on powerpc (and on other bigendian arch). (Closes: #381464) - -- Riccardo Setti <giskard@debian.org> Mon, 7 Aug 2006 17:06:47 +0200 + [ Michael Biebl ] + * Merged the patches 05-resolvconf.patch and 08-disabled_devices.patch into + a single patch called 05-debian_backend.patch. + * Updated 05-debian_backend.patch to not control mapped interfaces. + (Closes: #377498) + + -- Michael Biebl <biebl@teco.edu> Tue, 8 Aug 2006 01:51:13 +0200 network-manager (0.6.3-2) unstable; urgency=low diff --git a/debian/patches/05-debian_backend.patch b/debian/patches/05-debian_backend.patch new file mode 100644 index 00000000..84c7238e --- /dev/null +++ b/debian/patches/05-debian_backend.patch @@ -0,0 +1,123 @@ +diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c +index 740572a..8090696 100644 +--- a/src/backends/NetworkManagerDebian.c ++++ b/src/backends/NetworkManagerDebian.c +@@ -37,6 +37,7 @@ #include "interface_parser.h" + #include "nm-utils.h" + + #define ARPING "/usr/sbin/arping" ++#define RESOLVCONF "resolvconf" + + /* + * nm_system_init +@@ -514,13 +515,60 @@ gboolean nm_system_device_get_use_dhcp ( + /* + * nm_system_device_get_disabled + * +- * Return whether the distro-specific system config tells us to use +- * dhcp for this device. ++ * Return whether the distro-specific system config tells us to disable ++ * this device. + * + */ + gboolean nm_system_device_get_disabled (NMDevice *dev) + { +- return FALSE; ++ const char *iface; ++ if_block *curr_device, *curr_b; ++ if_data *curr_d; ++ gboolean blacklist = TRUE; ++ ++ g_return_val_if_fail (dev != NULL, TRUE); ++ ++ iface = nm_device_get_iface (dev); ++ ++ ifparser_init (); ++ ++ /* If the device is listed in a mapping, do not control it */ ++ if (ifparser_getmapping (iface) != NULL) { ++ blacklist = TRUE; ++ goto out; ++ } ++ ++ /* If the interface isn't listed in /etc/network/interfaces then ++ * it's considered okay to control it. ++ */ ++ curr_device = ifparser_getif (iface); ++ if (curr_device == NULL) { ++ blacklist = FALSE; ++ goto out; ++ } ++ ++ /* If the interface is listed and isn't marked "auto" then it's ++ * definitely not okay to control it. ++ */ ++ for (curr_b = ifparser_getfirst (); curr_b; curr_b = curr_b->next) { ++ if ((!strcmp (curr_b->type, "auto") || !strcmp (curr_b->type, "allow-hotplug")) ++ && strstr (curr_b->name, iface)) ++ blacklist = FALSE; ++ } ++ ++ /* If the interface has no options other than just "inet dhcp" ++ * it's probably ok to fiddle with it. ++ */ ++ for (curr_d = curr_device->info; curr_d; curr_d = curr_d->next) { ++ if (strcmp (curr_d->key, "inet") ++ || strcmp (curr_d->data, "dhcp" )) ++ blacklist = TRUE; ++ } ++ ++out: ++ ifparser_destroy (); ++ ++ return blacklist; + } + + +@@ -679,7 +727,10 @@ void nm_system_set_hostname (NMIP4Config + */ + gboolean nm_system_should_modify_resolv_conf (void) + { +- return TRUE; ++ if (g_find_program_in_path(RESOLVCONF) != NULL) ++ return FALSE; ++ else ++ return TRUE; + } + + +diff --git a/src/backends/interface_parser.c b/src/backends/interface_parser.c +index 53d6487..aa81134 100644 +--- a/src/backends/interface_parser.c ++++ b/src/backends/interface_parser.c +@@ -198,6 +198,18 @@ if_block *ifparser_getif(const char* ifa + return NULL; + } + ++if_block *ifparser_getmapping(const char* iface) ++{ ++ if_block *curr = first; ++ while(curr!=NULL) ++ { ++ if (strcmp(curr->type,"mapping")==0 && strcmp(curr->name,iface)==0) ++ return curr; ++ curr = curr->next; ++ } ++ return NULL; ++} ++ + const char *ifparser_getkey(if_block* iface, const char *key) + { + if_data *curr = iface->info; +diff --git a/src/backends/interface_parser.h b/src/backends/interface_parser.h +index 075f454..8914283 100644 +--- a/src/backends/interface_parser.h ++++ b/src/backends/interface_parser.h +@@ -44,6 +44,7 @@ void ifparser_init(void); + void ifparser_destroy(void); + + if_block *ifparser_getif(const char* iface); ++if_block *ifparser_getmapping(const char* iface); + if_block *ifparser_getfirst(void); + const char *ifparser_getkey(if_block* iface, const char *key); + diff --git a/debian/patches/05-resolvconf.patch b/debian/patches/05-resolvconf.patch deleted file mode 100644 index 8e55c8fa..00000000 --- a/debian/patches/05-resolvconf.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/backends/NetworkManagerDebian.c 2006-02-28 22:24:22.000000000 +0100 -+++ ../NetworkManager-0.6.0.patched/src/backends/NetworkManagerDebian.c 2006-03-06 12:19:34.000000000 +0100 -@@ -37,6 +37,7 @@ - #include "nm-utils.h" - - #define ARPING "/usr/sbin/arping" -+#define RESOLVCONF "resolvconf" - - /* - * nm_system_init -@@ -679,5 +680,8 @@ - */ - gboolean nm_system_should_modify_resolv_conf (void) - { -- return TRUE; -+ if (g_find_program_in_path(RESOLVCONF) != NULL) -+ return FALSE; -+ else -+ return TRUE; - } diff --git a/debian/patches/08-disabled_devices.patch b/debian/patches/08-disabled_devices.patch deleted file mode 100644 index 07b87d9a..00000000 --- a/debian/patches/08-disabled_devices.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- src/backends/NetworkManagerDebian.c.orig 2006-05-05 19:59:18.000000000 +0200 -+++ src/backends/NetworkManagerDebian.c 2006-05-05 20:04:34.000000000 +0200 -@@ -521,7 +521,48 @@ - */ - gboolean nm_system_device_get_disabled (NMDevice *dev) - { -- return FALSE; -+ const char *iface; -+ if_block *curr_device, *curr_b; -+ if_data *curr_d; -+ gboolean blacklist = TRUE; -+ -+ g_return_val_if_fail (dev != NULL, TRUE); -+ -+ iface = nm_device_get_iface (dev); -+ -+ ifparser_init (); -+ -+ /* If the interface isn't listed in /etc/network/interfaces then -+ * it's considered okay to control it. -+ */ -+ curr_device = ifparser_getif (iface); -+ if (curr_device == NULL) { -+ blacklist = FALSE; -+ goto out; -+ } -+ -+ /* If the interface is listed and isn't marked "auto" then it's -+ * definitely not okay to control it. -+ */ -+ for (curr_b = ifparser_getfirst(); curr_b; curr_b = curr_b->next) { -+ if ((!strcmp (curr_b->type, "auto") || !strcmp (curr_b->type, "allow-hotplug")) -+ && strstr (curr_b->name, iface)) -+ blacklist = FALSE; -+ } -+ -+ /* If the interface has no options other than just "inet dhcp" -+ * it's probably ok to fiddle with it. -+ */ -+ for (curr_d = curr_device->info; curr_d; curr_d = curr_d->next) { -+ if (strcmp (curr_d->key, "inet") -+ || strcmp (curr_d->data, "dhcp" )) -+ blacklist = TRUE; -+ } -+ -+out: -+ ifparser_destroy (); -+ -+ return blacklist; - } - - |