summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-01-16 13:20:55 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-01-16 13:20:55 +0800
commitbdf16b183ad8da216ff332157d6538b66e934833 (patch)
tree30eaa946c944e6cf3fb4c7c06e7b1ffad62dadf3
parentfix flush_to_file (diff)
downloadqiaomuf-bdf16b183ad8da216ff332157d6538b66e934833.tar.gz
qiaomuf-bdf16b183ad8da216ff332157d6538b66e934833.tar.bz2
qiaomuf-bdf16b183ad8da216ff332157d6538b66e934833.zip
Do not remove old connection when ssid is not changed
(Portage version: 2.1.9.31/git/Linux x86_64, signed Manifest commit with key 17B157E9)
-rw-r--r--net-misc/networkmanager/Manifest18
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch179
-rw-r--r--net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild (renamed from net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild)0
3 files changed, 172 insertions, 25 deletions
diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest
index 5ea61a7..7a23246 100644
--- a/net-misc/networkmanager/Manifest
+++ b/net-misc/networkmanager/Manifest
@@ -5,22 +5,22 @@ AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98
AUX networkmanager-0.8.2-1.patch 6642 RMD160 466f7c2bd34043d13d1b265f4a52b172c594430e SHA1 7af80cb4ea3cf1d60566c8dacd3eadc3ef4cc186 SHA256 f29cfa186c9b77452266e9c303711c2368986fb7e5455e388a5dfe064e80b3e3
AUX networkmanager-0.8.2-accept-gw.patch 3679 RMD160 b163afa5215f0eb52ba2562d22c65ec5e0bd3380 SHA1 a71f25413abf0c359439add74a73545790604ac9 SHA256 631ccad5bc4c2d880b5235bc8e6ace494467bad1734023ded9d8bcd52b9177af
AUX networkmanager-0.8.2-confchanges.patch 1279 RMD160 1ff5b6d663aa4417beaf9c7630d710a17a1812b5 SHA1 634ad19b189509e75362e5cd7f069ca795b4aeba SHA256 7c9ed8dc35b5b6d0414f96902fbe8117408ad556af655c0afc593ec5a1beac28
-AUX networkmanager-0.8.2-shared-connection.patch 10242 RMD160 26df22af1ee21f321890e36b88384b60ab795d5f SHA1 fc3c3abcf4599b536c7f173a72819b7c5f48f607 SHA256 a980aaa2e03f409e0607f32f9943282cc067ddeb3eca7c3b5b68e5f85698ff2f
+AUX networkmanager-0.8.2-shared-connection.patch 14877 RMD160 5897156374833d29253fdba9f2f8aaf6a7a32d87 SHA1 842dc7a682578f7659d864b400b23d25d373933d SHA256 7dc3157415800291eaac8a26bb9072e2dfa7021276c678b389cd34d07996532b
AUX nm-system-settings.conf 23 RMD160 6d66c702b345bde668a420a15716feea6005fbd1 SHA1 49ba558d20f5ca5a201e027e13b878dd5ac3569c SHA256 44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21
AUX nm-system-settings.conf-ifnet 70 RMD160 c0d2be147383999b62cead86ab4333169e4ef277 SHA1 679ec8052b610969c148a2d34cd4da7a41484a76 SHA256 34f53d9ac1ad65eda6942dc3059117f60f6321059ca23f4fbfcc2f2edcae151f
DIST NetworkManager-0.8.2.tar.bz2 1629296 RMD160 d5ef4adfc74db4a77fadcbeb545175b2f49dfd9c SHA1 2c9a9f0317d2ad4fd8a05631211cfd6040070f8e SHA256 58e49dcd83cb641a9dcaad4fd566a08196c862479ad3086c00f28f03768eb4f1
-EBUILD networkmanager-0.8.2-r103.ebuild 4202 RMD160 16fddd8bd4a77905a47850fecb12dd4a2d266931 SHA1 00daba60673f8886fa23efef7ad95193a8a5423d SHA256 78c93c5de6c2b1c1d46b1113f52c87df334a440e34d494d1af9efa6ab96764e2
+EBUILD networkmanager-0.8.2-r104.ebuild 4202 RMD160 16fddd8bd4a77905a47850fecb12dd4a2d266931 SHA1 00daba60673f8886fa23efef7ad95193a8a5423d SHA256 78c93c5de6c2b1c1d46b1113f52c87df334a440e34d494d1af9efa6ab96764e2
EBUILD networkmanager-9999.ebuild 4197 RMD160 4a64e0b4141d174eda2716f2a08f6ce5f0a52ed8 SHA1 fd2a1e026e7625312431048ccca94216c3936b76 SHA256 006eea72c4dfc9e605d353c47ad85b8a6a70cbd0eb784aa363b49397b53e393a
MISC ChangeLog 18915 RMD160 6b010bfb98563502a1503c06f962ab2c030043f3 SHA1 88a338f79f4c7980b0322642aa055bb2ffb2adb9 SHA256 c4f984efef8828c8d04cc34ec4b42b187f012515bcb4675ae10fa1005f97f00d
MISC metadata.xml 975 RMD160 7f7f8f54c53fe2098dae8ed0a4cd177900289d3f SHA1 11de32f78915bbc01c6b0665b45233d004d75c25 SHA256 e0ce95394f82f5631ecec62c6595dc4dad9afc52cf5e1bb0f30618edfb79becc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
-iQEcBAEBAgAGBQJNMCaTAAoJEDCzDeQXsVfp5aQIAK1Jq71uax+PQxFk/ja31lbs
-Jo+1WYq0NledDew9i18PVjp8orGPLEAKLRQbMZ8h+amQR2u/6AmSPjBrkrEnyAi6
-e4csy0/relzlj83XMsqkOvIQC46TY4UZW/VjMEJIDZGJIYsDn9MgY3QagEG8H9uK
-6+OkCJIFqFNingqiCUquoDBo2avh6iau4k+fI4U8y7IDfQumsPPpuvYP2DPRdcr/
-e2YY5dMRJi4NX5qEjMAFMNzfpFL2cWwEQjhtTJ9jXaklF3Xx2fdyYqVOrbkExAeX
-rE2uZUvmblDuwVKYzbu+IpXJqjmz6+qvRaU2viFoN19vUaCXPgFc3NW1OJazYRI=
-=rlEy
+iQEcBAEBAgAGBQJNMoA3AAoJEDCzDeQXsVfpPeAH/iB6ZKYySfJAmWIwSijiuAPD
+WVgB+Q0l3VB1GkpnhnUPF6HZYySNIW3Plj0QXs7JI6QPKaR+0Hq2Hpy81wDPfiW8
+LA2TN4U38iZyB729miTjBuk1xMQXRHcUbGvNF1VU0EyIZbeK4QiTLPFbu0/j7ETK
+4lANcU8Jw590DdZq4udUCoePm6ThjOWpo1k0NyJw5XO0d9/3V13oZetdyckMQ/hp
+j1MCDwNf9rSY6+TIHQYxxENmPVTbn4gbicNkapEE0Zh2uujlZwRTmXoi8wVpmwc0
+ah7Yr5xFLjdgqo+8VR1L/fAIxGGfmcQemdXem4waXgaUI//byxeu7mIOb44fGOY=
+=fKIJ
-----END PGP SIGNATURE-----
diff --git a/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch
index 14cce76..49e94a0 100644
--- a/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch
+++ b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch
@@ -1,21 +1,24 @@
-From ea13027128e5d2781fe88805ee580cc9a49a8a4f Mon Sep 17 00:00:00 2001
+From 744f1789da873c98867855f2936c77310548b980 Mon Sep 17 00:00:00 2001
From: Mu Qiao <qiaomuf@gentoo.org>
Date: Wed, 5 Jan 2011 13:30:08 +0800
Subject: [PATCH] Support shared and link-local method for ipv4
Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
fix flush_to_file, return TRUE when nothing changed
ssid do not lose quotes anymore
+ do not delete old connection when ssid is not changed
+Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
---
- system-settings/plugins/ifnet/connection_parser.c | 77 +++++++++++++++-----
- system-settings/plugins/ifnet/net_parser.c | 14 +++-
+ system-settings/plugins/ifnet/connection_parser.c | 92 ++++++++++++++------
+ system-settings/plugins/ifnet/net_parser.c | 53 +++++++-----
+ system-settings/plugins/ifnet/net_parser.h | 4 +-
system-settings/plugins/ifnet/net_utils.c | 4 +
- .../plugins/ifnet/nm-ifnet-connection.c | 8 ++-
- system-settings/plugins/ifnet/wpa_parser.c | 19 +++--
- 5 files changed, 87 insertions(+), 35 deletions(-)
+ .../plugins/ifnet/nm-ifnet-connection.c | 8 +-
+ system-settings/plugins/ifnet/wpa_parser.c | 21 +++--
+ 6 files changed, 121 insertions(+), 61 deletions(-)
diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c
-index f9fae51..a755ec8 100644
+index f9fae51..539f33c 100644
--- a/system-settings/plugins/ifnet/connection_parser.c
+++ b/system-settings/plugins/ifnet/connection_parser.c
@@ -557,7 +557,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
@@ -134,7 +137,7 @@ index f9fae51..a755ec8 100644
if (auth_alg) {
if (!strcmp (auth_alg, "shared"))
-@@ -2180,12 +2211,14 @@ write_wireless_security_setting (NMConnection * connection,
+@@ -2180,8 +2211,11 @@ write_wireless_security_setting (NMConnection * connection,
g_string_append (quoted, psk);
g_string_append_c (quoted, '"');
}
@@ -147,13 +150,32 @@ index f9fae51..a755ec8 100644
+ PLUGIN_WARN (IFNET_PLUGIN_NAME, "Use WPA, but no psk received from NM");
if (quoted)
g_string_free (quoted, TRUE);
-- } else
-- wpa_set_data (conn_name, "psk", NULL);
+ } else
+@@ -2190,15 +2224,19 @@ write_wireless_security_setting (NMConnection * connection,
+ return TRUE;
+ }
+
+-/* remove old ssid and add new one*/
++/* Only remove old config when ssid is changed.
++ * See bug #350476.
++ * */
+ static void
+ update_wireless_ssid (NMConnection * connection, gchar * conn_name,
+ gchar * ssid, gboolean hex)
+ {
+- ifnet_delete_network (conn_name);
+- ifnet_add_connection (ssid, "wireless");
++ if (strcmp (conn_name, ssid)){
++ ifnet_delete_network (conn_name);
++ wpa_delete_security (conn_name);
+ }
- return TRUE;
+- wpa_delete_security (conn_name);
++ ifnet_add_network (ssid, "wireless");
+ wpa_add_security (ssid);
}
-@@ -2443,8 +2476,12 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name,
+
+@@ -2443,8 +2481,12 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name,
}
ifnet_set_data (conn_name, "config", ips->str);
g_string_free (ips, TRUE);
@@ -168,11 +190,86 @@ index f9fae51..a755ec8 100644
/* DNS Servers */
ifnet_set_data (conn_name, "dns_servers", NULL);
+@@ -2858,7 +2900,7 @@ get_wired_name ()
+ for (; i < 256; i++) {
+ gchar *conn_name = g_strdup_printf ("eth%d", i);
+
+- if (!ifnet_has_connection (conn_name)) {
++ if (!ifnet_has_network (conn_name)) {
+ return conn_name;
+ } else
+ g_free (conn_name);
+@@ -2875,7 +2917,7 @@ get_ppp_name ()
+ for (; i < 256; i++) {
+ gchar *conn_name = g_strdup_printf ("ppp%d", i);
+
+- if (!ifnet_has_connection (conn_name)) {
++ if (!ifnet_has_network (conn_name)) {
+ return conn_name;
+ } else
+ g_free (conn_name);
+@@ -2982,7 +3024,7 @@ ifnet_add_new_connection (NMConnection * connection,
+ goto out;
+ }
+
+- if (ifnet_add_connection (new_name, new_type))
++ if (ifnet_add_network (new_name, new_type))
+ success =
+ ifnet_update_parsers_by_connection (connection, new_name,
+ NULL, config_file,
diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c
-index b4a381d..9f58e91 100644
+index b4a381d..8dc4f7f 100644
--- a/system-settings/plugins/ifnet/net_parser.c
+++ b/system-settings/plugins/ifnet/net_parser.c
-@@ -377,21 +377,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value)
+@@ -37,6 +37,9 @@ static GList *functions_list;
+ /* Used to decide whether to write changes to file*/
+ static gboolean net_parser_data_changed = FALSE;
+
++static void
++destroy_connection_config (GHashTable * conn);
++
+ static GHashTable *
+ add_new_connection_config (const gchar * type, const gchar * name)
+ {
+@@ -58,7 +61,7 @@ add_new_connection_config (const gchar * type, const gchar * name)
+ }
+
+ gboolean
+-ifnet_add_connection (gchar * name, gchar * type)
++ifnet_add_network (gchar * name, gchar * type)
+ {
+ if (add_new_connection_config (type, name)) {
+ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name);
+@@ -69,11 +72,27 @@ ifnet_add_connection (gchar * name, gchar * type)
+ }
+
+ gboolean
+-ifnet_has_connection (gchar * conn_name)
++ifnet_has_network (gchar * conn_name)
+ {
+ return g_hash_table_lookup (conn_table, conn_name) != NULL;
+ }
+
++gboolean
++ifnet_delete_network (gchar * conn_name)
++{
++ GHashTable *network = NULL;
++
++ g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE);
++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name);
++ network = g_hash_table_lookup (conn_table, conn_name);
++ if (!network)
++ return FALSE;
++ g_hash_table_remove (conn_table, conn_name);
++ destroy_connection_config (network);
++ net_parser_data_changed = TRUE;
++ return TRUE;
++}
++
+ static GHashTable *
+ get_connection_config (gchar * name)
+ {
+@@ -377,21 +396,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value)
{
gpointer orin_key = NULL, orin_value = NULL;
GHashTable *conn = g_hash_table_lookup (conn_table, conn_name);
@@ -203,7 +300,7 @@ index b4a381d..9f58e91 100644
net_parser_data_changed = TRUE;
}
-@@ -467,7 +473,7 @@ ifnet_flush_to_file (gchar * config_file)
+@@ -467,7 +492,7 @@ ifnet_flush_to_file (gchar * config_file)
gboolean result = FALSE;
if (!net_parser_data_changed)
@@ -212,6 +309,47 @@ index b4a381d..9f58e91 100644
if (!conn_table || !global_settings_table)
return FALSE;
+@@ -583,22 +608,6 @@ ifnet_flush_to_file (gchar * config_file)
+ return result;
+ }
+
+-gboolean
+-ifnet_delete_network (gchar * conn_name)
+-{
+- GHashTable *network = NULL;
+-
+- g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE);
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name);
+- network = g_hash_table_lookup (conn_table, conn_name);
+- if (!network)
+- return FALSE;
+- g_hash_table_remove (conn_table, conn_name);
+- destroy_connection_config (network);
+- net_parser_data_changed = TRUE;
+- return TRUE;
+-}
+-
+ void
+ ifnet_destroy (void)
+ {
+diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h
+index 73a44c8..b71a01f 100644
+--- a/system-settings/plugins/ifnet/net_parser.h
++++ b/system-settings/plugins/ifnet/net_parser.h
+@@ -36,11 +36,11 @@ GList *ifnet_get_connection_names (void);
+ gchar *ifnet_get_data (gchar * conn_name, const gchar * key);
+ gchar *ifnet_get_global_data (const gchar * key);
+ gchar *ifnet_get_global_setting (gchar * group, gchar * key);
+-gboolean ifnet_has_connection (gchar * conn_name);
++gboolean ifnet_has_network (gchar * conn_name);
+
+ /* Writer functions */
+ gboolean ifnet_flush_to_file (gchar * config_file);
+ void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value);
+-gboolean ifnet_add_connection (gchar * name, gchar * type);
++gboolean ifnet_add_network (gchar * name, gchar * type);
+ gboolean ifnet_delete_network (gchar * conn_name);
+ #endif
diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c
index 2dc253c..7e52f10 100644
--- a/system-settings/plugins/ifnet/net_utils.c
@@ -250,7 +388,7 @@ index e47495c..ebe2581 100644
NM_IFNET_CONNECTION_CONN_NAME,
conn_name, NULL);
diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c
-index 5e94108..726e4b2 100644
+index 5e94108..42c52c3 100644
--- a/system-settings/plugins/ifnet/wpa_parser.c
+++ b/system-settings/plugins/ifnet/wpa_parser.c
@@ -366,7 +366,7 @@ wpa_flush_to_file (gchar * config_file)
@@ -299,6 +437,15 @@ index 5e94108..726e4b2 100644
wpa_parser_data_changed = TRUE;
}
+@@ -483,7 +486,7 @@ gboolean
+ wpa_add_security (gchar * ssid)
+ {
+ if (wpa_has_security (ssid))
+- return FALSE;
++ return TRUE;
+ else {
+ GHashTable *security =
+ g_hash_table_new (g_str_hash, g_str_equal);
--
1.7.3.4
diff --git a/net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild
index 8094376..8094376 100644
--- a/net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild
+++ b/net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild