summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2010-11-30 09:35:18 +0000
committerMu Qiao <qiaomuf@gentoo.org>2010-11-30 09:35:18 +0000
commit2f679e404b46d2b46683a521d13559de5cd27113 (patch)
tree9d1f95d44d9bd166173ac6f4ea874b64de50b92e /net-misc/networkmanager
parentFixing libmemcached minimum version (diff)
downloadgentoo-2-2f679e404b46d2b46683a521d13559de5cd27113.tar.gz
gentoo-2-2f679e404b46d2b46683a521d13559de5cd27113.tar.bz2
gentoo-2-2f679e404b46d2b46683a521d13559de5cd27113.zip
Accept "gw" by the plugin. That should fix bug #339215
(Portage version: 2.1.9.25/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/networkmanager')
-rw-r--r--net-misc/networkmanager/ChangeLog8
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8.2-accept-gw.patch135
-rw-r--r--net-misc/networkmanager/networkmanager-0.8.2-r1.ebuild (renamed from net-misc/networkmanager/networkmanager-0.8.2.ebuild)7
3 files changed, 148 insertions, 2 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog
index 272215163abb..f24feb0a7991 100644
--- a/net-misc/networkmanager/ChangeLog
+++ b/net-misc/networkmanager/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/networkmanager
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.88 2010/11/10 12:57:16 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.89 2010/11/30 09:35:18 qiaomuf Exp $
+
+*networkmanager-0.8.2-r1 (30 Nov 2010)
+
+ 30 Nov 2010; <gentoo@gentoo.org> +networkmanager-0.8.2-r1.ebuild,
+ +files/networkmanager-0.8.2-accept-gw.patch:
+ Accept "gw" by ifnet plugin for bug #339215
28 Oct 2010; Samuli Suominen <ssuominen@gentoo.org>
networkmanager-0.8-r1.ebuild:
diff --git a/net-misc/networkmanager/files/networkmanager-0.8.2-accept-gw.patch b/net-misc/networkmanager/files/networkmanager-0.8.2-accept-gw.patch
new file mode 100644
index 000000000000..b2911db71a9a
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.8.2-accept-gw.patch
@@ -0,0 +1,135 @@
+--- NetworkManager_Patched/system-settings/plugins/ifnet/net_utils.c 2010-11-04 04:10:52.000000000 +0800
++++ NetworkManager-0.8.2/system-settings/plugins/ifnet/net_utils.c 2010-11-23 15:11:08.024000011 +0800
+@@ -19,7 +19,6 @@
+ * Copyright (C) 1999-2010 Gentoo Foundation, Inc.
+ */
+
+-#include <config.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -194,6 +193,32 @@
+ return error_quark;
+ }
+
++static char *
++find_default_gateway_str (char *str)
++{
++ char *tmp;
++
++ if ((tmp = strstr (str, "default via ")) != NULL) {
++ return tmp + strlen ("default via ");
++ } else if ((tmp = strstr (str, "default gw ")) != NULL) {
++ return tmp + strlen ("default gw ");
++ }
++ return NULL;
++}
++
++static char *
++find_gateway_str (char *str)
++{
++ char *tmp;
++
++ if ((tmp = strstr (str, "via ")) != NULL) {
++ return tmp + strlen ("via ");
++ } else if ((tmp = strstr (str, "gw ")) != NULL) {
++ return tmp + strlen ("gw ");
++ }
++ return NULL;
++}
++
+ gboolean
+ reload_parsers ()
+ {
+@@ -362,11 +387,10 @@
+ if (!tmp)
+ return FALSE;
+ routes = g_strdup (tmp);
+- tmp = strstr (routes, "default via ");
++ tmp = find_default_gateway_str (routes);
+ if (!tmp) {
+ goto error;
+ }
+- tmp += strlen ("default via ");
+ g_strstrip (tmp);
+ if ((end = strstr (tmp, "\"")) != NULL)
+ *end = '\0';
+@@ -483,8 +507,13 @@
+
+ if (!gateway)
+ return 0;
+- tmp = strstr (gateway, "via ");
+- tmp = g_strdup (tmp + strlen ("via "));
++ tmp = find_gateway_str(gateway);
++ if (!tmp) {
++ PLUGIN_WARN (IFNET_PLUGIN_NAME,
++ "Couldn't obtain gateway in \"%s\"", gateway);
++ return 0;
++ }
++ tmp = g_strdup (tmp);
+ strip_string (tmp, ' ');
+ strip_string (tmp, '"');
+ if ((split = strstr (tmp, "\"")) != NULL)
+@@ -509,8 +538,13 @@
+
+ if (!next_hop)
+ return 0;
+- tmp = strstr (next_hop, "via ");
+- tmp = g_strdup (tmp + strlen ("via "));
++ tmp = find_gateway_str(next_hop);
++ if (!tmp) {
++ PLUGIN_WARN (IFNET_PLUGIN_NAME,
++ "Couldn't obtain next_hop in \"%s\"", next_hop);
++ return 0;
++ }
++ tmp = g_strdup (tmp);
+ strip_string (tmp, ' ');
+ strip_string (tmp, '"');
+ g_strstrip (tmp);
+@@ -671,8 +705,8 @@
+ length = g_strv_length (ipset);
+ for (i = 0; i < length; i++) {
+ ip = ipset[i];
+- if (strstr (ip, "default via ") || strstr (ip, "::")
+- || !strstr (ip, "via"))
++ if (find_default_gateway_str (ip) || strstr (ip, "::")
++ || !find_gateway_str (ip))
+ continue;
+ ip = strip_string (ip, '"');
+ iblock = create_ip4_block (ip);
+@@ -712,9 +746,7 @@
+ ip = strip_string (ip, '"');
+ if (ip[0] == '\0')
+ continue;
+- printf ("ip:%s\n", ip);
+- if ((tmp_addr = strstr (ip, "default via ")) != NULL) {
+- tmp_addr += strlen ("default via ");
++ if ((tmp_addr = find_default_gateway_str (ip)) != NULL) {
+ if (!is_ip6_address (tmp_addr))
+ continue;
+ else {
+@@ -855,7 +887,7 @@
+ void
+ get_dhcp_hostname_and_client_id (char **hostname, char **client_id)
+ {
+- gchar *dhcp_client = ifnet_get_global_setting ("main", "dhcp");
++ gchar *dhcp_client = NULL;
+ const gchar *dhcpcd_conf = "/etc/dhcpcd.conf";
+ const gchar *dhclient_conf = "/etc/dhcp/dhclient.conf";
+ gchar *line = NULL, *tmp = NULL, *contents = NULL;
+@@ -864,6 +896,7 @@
+
+ *hostname = NULL;
+ *client_id = NULL;
++ dhcp_client = ifnet_get_global_setting ("main", "dhcp");
+ if (dhcp_client) {
+ if (!strcmp (dhcp_client, "dhclient"))
+ g_file_get_contents (dhclient_conf, &contents, NULL,
+@@ -871,6 +904,7 @@
+ else if (!strcmp (dhcp_client, "dhcpcd"))
+ g_file_get_contents (dhcpcd_conf, &contents, NULL,
+ NULL);
++ g_free (dhcp_client);
+ } else {
+ if (g_file_test (dhclient_conf, G_FILE_TEST_IS_REGULAR))
+ g_file_get_contents (dhclient_conf, &contents, NULL,
diff --git a/net-misc/networkmanager/networkmanager-0.8.2.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r1.ebuild
index 44efc14f827c..f39e3320da2f 100644
--- a/net-misc/networkmanager/networkmanager-0.8.2.ebuild
+++ b/net-misc/networkmanager/networkmanager-0.8.2-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.2.ebuild,v 1.1 2010/11/10 12:57:16 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.2-r1.ebuild,v 1.1 2010/11/30 09:35:18 qiaomuf Exp $
EAPI="2"
@@ -80,6 +80,11 @@ pkg_setup() {
fi
}
+src_prepare() {
+ # accept "gw" in /etc/conf.d/net (bug #339215)
+ epatch "${FILESDIR}/${P}-accept-gw.patch"
+}
+
src_configure() {
ECONF="--disable-more-warnings
--localstatedir=/var