Hello community,
here is the log from the commit of package NetworkManager
checked in at Sat Jul 5 02:16:08 CEST 2008.
--------
--- NetworkManager/NetworkManager.changes 2008-06-04 10:40:40.000000000 +0200
+++ NetworkManager/NetworkManager.changes 2008-07-02 10:21:44.874608000 +0200
@@ -1,0 +2,12 @@
+Mon Jun 30 11:26:30 CEST 2008 - tambet@suse.de
+
+ SWAMP-ID: 18426
+
+- Don't assume DHCP server always returns a gateway (bnc #392598).
+- Missing default route in case the gateways is in another subnet (bnc #266215).
+- Cannot enter PIN code with some modems (bnc #394731).
+- Changes in yast not picked up until reboot (bnc #378802).
+- Make sure pppd is shut down, even if it's blockin on reads (bnc #394598).
+- Fix a lifetime issue with VPN services (bnc #381769).
+
+-------------------------------------------------------------------
Old:
----
nm-dhclient-conf-path.patch
nm-unmanaged-devices.patch
New:
----
0001-Fix-wireless-bssid-setting.patch
0002-VPN-service-lifetime.patch
0003-Suse-plugin-unmanaged-devices-crasher-fix.patch
0004-Don-t-fall-back-to-using-DHCP-server-for-default-gat.patch
0005-Check-PIN-before-resetting-modem.patch
0006-Reload-yast-settings-on-changes.patch
0007-Fix-memory-leaks.patch
0008-Show-default-device-in-nm-tool.patch
0009-Fix-AP-reference-counting.patch
0010-Use-distro-specific-dhclient.conf-path.patch
0011-Fix-setting-route-to-gateway-where-gateway-is-in-ano.patch
0012-Use-user-provided-APN.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ NetworkManager.spec ++++++
--- /var/tmp/diff_new_pack.TkN778/_old 2008-07-05 02:06:18.000000000 +0200
+++ /var/tmp/diff_new_pack.TkN778/_new 2008-07-05 02:06:18.000000000 +0200
@@ -13,7 +13,7 @@
Name: NetworkManager
Url: http://www.gnome.org/projects/NetworkManager/
Version: 0.7.0.r3685
-Release: 6
+Release: 13
License: GPL v2 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: PolicyKit-devel hal-devel intltool iproute2 libgcrypt-devel libnl-devel libtool mozilla-nss-devel ppp-devel wireless-tools
@@ -24,10 +24,21 @@
Source0: NetworkManager-%{version}.tar.bz2
Source1: nfs
Source2: nm-system-settings.conf
-Patch0: nm-dhclient-conf-path.patch
-Patch1: nm-unmanaged-devices.patch
+Patch1: 0001-Fix-wireless-bssid-setting.patch
+Patch2: 0002-VPN-service-lifetime.patch
+Patch3: 0003-Suse-plugin-unmanaged-devices-crasher-fix.patch
+Patch4: 0004-Don-t-fall-back-to-using-DHCP-server-for-default-gat.patch
+Patch5: 0005-Check-PIN-before-resetting-modem.patch
+Patch6: 0006-Reload-yast-settings-on-changes.patch
+Patch7: 0007-Fix-memory-leaks.patch
+Patch8: 0008-Show-default-device-in-nm-tool.patch
+Patch9: 0009-Fix-AP-reference-counting.patch
+Patch10: 0010-Use-distro-specific-dhclient.conf-path.patch
+Patch11: 0011-Fix-setting-route-to-gateway-where-gateway-is-in-ano.patch
+Patch12: 0012-Use-user-provided-APN.patch
Requires: wpa_supplicant >= 0.5.8-54
Requires: dhcp-client
+Requires: mozilla-nss
Obsoletes: dhcdbd <= 1.14
Provides: dhcdbd <= 1.14
@@ -90,8 +101,18 @@
%prep
%setup -n %{name}-0.7.0 -q
-%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
pppddir=`ls -1d /usr/%_lib/pppd/2*`
test -n "$pppddir" || exit 1
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@@ -184,6 +205,14 @@
%{_libdir}/libnm_glib_vpn.so.*
%changelog
+* Mon Jun 30 2008 tambet@suse.de
+ SWAMP-ID: 18426
+- Don't assume DHCP server always returns a gateway (bnc #392598).
+- Missing default route in case the gateways is in another subnet (bnc #266215).
+- Cannot enter PIN code with some modems (bnc #394731).
+- Changes in yast not picked up until reboot (bnc #378802).
+- Make sure pppd is shut down, even if it's blockin on reads (bnc #394598).
+- Fix a lifetime issue with VPN services (bnc #381769).
* Wed Jun 04 2008 tambet@suse.de
- Fix a bug where NetworkManager does not work at all in case there are
devices marked with NM_CONTROLLED="no" (bnc #390404).
++++++ 0001-Fix-wireless-bssid-setting.patch ++++++
From 8ad67a4573deb2bf847c03c73d81273eccb47068 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 11:29:07 +0300
Subject: [PATCH] Fix wireless bssid setting.
2008-05-23 Dan Williams
* src/supplicant-manager/nm-supplicant-settings-verify.c
- Switch 'bssid' from bytes to keyword type
- (validate_type_keyword): allow NULL keyword lists
* src/supplicant-manager/nm-supplicant-config.c
- (nm_supplicant_config_add_setting_wireless): convert the bssid from
a byte array to string form, which is what the supplicant expects
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3686 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index 4b3b109..6926a19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-05-23 Dan Williams
+
+ * src/supplicant-manager/nm-supplicant-settings-verify.c
+ - Switch 'bssid' from bytes to keyword type
+ - (validate_type_keyword): allow NULL keyword lists
+
+ * src/supplicant-manager/nm-supplicant-config.c
+ - (nm_supplicant_config_add_setting_wireless): convert the bssid from
+ a byte array to string form, which is what the supplicant expects
+
2008-05-23 Tambet Ingo
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS
diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c
index 58839eb..23f563c 100644
--- a/src/supplicant-manager/nm-supplicant-config.c
+++ b/src/supplicant-manager/nm-supplicant-config.c
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include "nm-supplicant-config.h"
@@ -323,6 +324,9 @@ nm_supplicant_config_get_blobs (NMSupplicantConfig * self)
return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->blobs;
}
+#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
+#define MAC_ARG(x) ((guint8*)(x))[0],((guint8*)(x))[1],((guint8*)(x))[2],((guint8*)(x))[3],((guint8*)(x))[4],((guint8*)(x))[5]
+
gboolean
nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
NMSettingWireless * setting,
@@ -383,14 +387,18 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
return FALSE;
}
- if (setting->bssid) {
+ if (setting->bssid && setting->bssid->len) {
+ char *str_bssid;
+
+ str_bssid = g_strdup_printf (MAC_FMT, MAC_ARG (setting->bssid->data));
if (!nm_supplicant_config_add_option (self, "bssid",
- (char *) setting->bssid->data,
- setting->bssid->len,
- FALSE)) {
+ str_bssid, strlen (str_bssid),
+ FALSE)) {
+ g_free (str_bssid);
nm_warning ("Error adding BSSID to supplicant config.");
return FALSE;
}
+ g_free (str_bssid);
}
// FIXME: band & channel config items
diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.c b/src/supplicant-manager/nm-supplicant-settings-verify.c
index ef022fe..4157b99 100644
--- a/src/supplicant-manager/nm-supplicant-settings-verify.c
+++ b/src/supplicant-manager/nm-supplicant-settings-verify.c
@@ -83,7 +83,7 @@ const char * phase2_allowed[] = {"auth=PAP", "auth=CHAP", "auth=MSCHAP",
static const struct Opt opt_table[] = {
{ "ssid", TYPE_BYTES, 0, 32,FALSE, NULL },
- { "bssid", TYPE_BYTES, 0, 6, FALSE, NULL },
+ { "bssid", TYPE_KEYWORD, 0, 0, FALSE, NULL },
{ "scan_ssid", TYPE_INT, 0, 1, FALSE, NULL },
{ "mode", TYPE_INT, 0, 1, FALSE, NULL },
{ "frequency", TYPE_INT, 2412, 5825, FALSE, NULL },
@@ -177,6 +177,10 @@ validate_type_keyword (const struct Opt * opt,
g_return_val_if_fail (opt != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
+ /* Allow everything */
+ if (!opt->str_allowed)
+ return TRUE;
+
candidates = g_strsplit (value, " ", 0);
if (!candidates)
goto out;
--
1.5.4.5
++++++ 0002-VPN-service-lifetime.patch ++++++
From dfadc70df865093277e638b2760ae38bf3740c7b Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 11:30:06 +0300
Subject: [PATCH] VPN service lifetime.
2008-05-26 Tambet Ingo
* src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_get_service): Fix a
reference counting issue.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3692 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index 6926a19..5f71f36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-26 Tambet Ingo
+
+ * src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_get_service): Fix a
+ reference counting issue.
+
2008-05-23 Dan Williams
* src/supplicant-manager/nm-supplicant-settings-verify.c
diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c
index c9a0cd3..cef4a19 100644
--- a/src/vpn-manager/nm-vpn-manager.c
+++ b/src/vpn-manager/nm-vpn-manager.c
@@ -72,7 +72,7 @@ nm_vpn_manager_get_service (NMVPNManager *manager, const char *service_name)
NMVPNService *service = NM_VPN_SERVICE (iter->data);
if (!strcmp (service_name, nm_vpn_service_get_name (service)))
- return service;
+ return g_object_ref (service);
}
return NULL;
--
1.5.4.5
++++++ 0003-Suse-plugin-unmanaged-devices-crasher-fix.patch ++++++
From 84051a04e8afc4d9205214d22d31890f2f99eee2 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 11:30:58 +0300
Subject: [PATCH] Suse plugin unmanaged devices crasher fix.
2008-05-26 Tambet Ingo
* system-settings/plugins/ifcfg-suse/plugin.c (get_unamanged_devices_cb):
Fix a typo.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3693 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index 5f71f36..5877ba2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-05-26 Tambet Ingo
+ * system-settings/plugins/ifcfg-suse/plugin.c (get_unamanged_devices_cb):
+ Fix a typo.
+
+2008-05-26 Tambet Ingo
+
* src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_get_service): Fix a
reference counting issue.
diff --git a/system-settings/plugins/ifcfg-suse/plugin.c b/system-settings/plugins/ifcfg-suse/plugin.c
index 22fc72d..da08cf1 100644
--- a/system-settings/plugins/ifcfg-suse/plugin.c
+++ b/system-settings/plugins/ifcfg-suse/plugin.c
@@ -313,7 +313,7 @@ get_unamanged_devices_cb (gpointer key, gpointer val, gpointer user_data)
{
GSList **list = (GSList **) key;
- *list = g_slist_prepend (*list, g_strdup ((char *) val));
+ *list = g_slist_prepend (*list, g_strdup ((char *) key));
}
static GSList *
--
1.5.4.5
++++++ 0004-Don-t-fall-back-to-using-DHCP-server-for-default-gat.patch ++++++
From 1994a29c434822a931af96472fd62eff2cc731ef Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 12:51:31 +0300
Subject: [PATCH] Don't fall back to using DHCP server for default gateway.
2008-05-28 Tambet Ingo
* src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Make sure
pppd gets killed, if SIGTERM doesn't do it's job, SIGKILL it.
* src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config):
Use inet_aton() everywhere to improve error detection.
Don't fall back to 'dhcp_server_identifier' if the gateway is not
provided.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3695 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index 5877ba2..5234aad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-05-28 Tambet Ingo
+
+ * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Make sure
+ pppd gets killed, if SIGTERM doesn't do it's job, SIGKILL it.
+
+ * src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config):
+ Use inet_aton() everywhere to improve error detection.
+ Don't fall back to 'dhcp_server_identifier' if the gateway is not
+ provided.
+
2008-05-26 Tambet Ingo
* system-settings/plugins/ifcfg-suse/plugin.c (get_unamanged_devices_cb):
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index 3f338e0..732b969 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+
/* nm-dhcp-manager.c - Handle the DHCP daemon for NetworkManager
*
* Copyright (C) 2005 Dan Williams
@@ -835,8 +837,8 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
NMDHCPManagerPrivate *priv;
NMDHCPDevice *device;
NMIP4Config *ip4_config = NULL;
- NMSettingIP4Address *addr;
- guint32 ip4_num = 0;
+ struct in_addr tmp_addr;
+ NMSettingIP4Address *addr = NULL;
char *str = NULL;
g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL);
@@ -868,36 +870,26 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
}
str = g_hash_table_lookup (device->options, "new_ip_address");
- if (str != NULL) {
- addr->address = inet_addr (str);
- nm_info(" address %s", str);
- }
- if (!addr->address) {
- g_free (addr);
+ if (str && inet_aton (str, &tmp_addr)) {
+ addr->address = tmp_addr.s_addr;
+ nm_info (" address %s", str);
+ } else
goto error;
- }
str = g_hash_table_lookup (device->options, "new_subnet_mask");
- if (str != NULL) {
- addr->netmask = inet_addr (str);
- nm_info(" netmask %s", str);
+ if (str && inet_aton (str, &tmp_addr)) {
+ addr->netmask = tmp_addr.s_addr;
+ nm_info (" netmask %s", str);
}
str = g_hash_table_lookup (device->options, "new_routers");
- if (str != NULL) {
- addr->gateway = inet_addr (str);
- } else { /* If DHCP doesn't have a 'routers', just use the DHCP server's address as our gateway for now */
- str = g_hash_table_lookup (device->options, "new_dhcp_server_identifier");
- if (str != NULL)
- addr->gateway = inet_addr (str);
- else {
- g_free (addr);
- return NULL;
- }
+ if (str && inet_aton (str, &tmp_addr)) {
+ addr->gateway = tmp_addr.s_addr;
+ nm_info(" gateway %s", str);
}
- nm_info(" gateway %s", str);
nm_ip4_config_take_address (ip4_config, addr);
+ addr = NULL;
str = g_hash_table_lookup (device->options, "new_host_name");
if (str) {
@@ -911,10 +903,11 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
char **s;
for (s = searches; *s; s++) {
- // FIXME: use inet_aton
- ip4_num = inet_addr (*s);
- nm_ip4_config_add_nameserver (ip4_config, ip4_num);
- nm_info (" nameserver '%s'", *s);
+ if (inet_aton (*s, &tmp_addr)) {
+ nm_ip4_config_add_nameserver (ip4_config, tmp_addr.s_addr);
+ nm_info (" nameserver '%s'", *s);
+ } else
+ nm_warning ("Ignoring invalid nameserver '%s'", *s);
}
g_strfreev (searches);
}
@@ -955,10 +948,11 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
char **s;
for (s = searches; *s; s++) {
- // FIXME: use inet_aton
- ip4_num = inet_addr (*s);
- nm_ip4_config_add_nis_server (ip4_config, ip4_num);
- nm_info (" nis server '%s'", *s);
+ if (inet_aton (*s, &tmp_addr)) {
+ nm_ip4_config_add_nis_server (ip4_config, tmp_addr.s_addr);
+ nm_info (" nis server '%s'", *s);
+ } else
+ nm_warning ("Ignoring invalid nis server '%s'", *s);
}
g_strfreev (searches);
}
@@ -1006,6 +1000,10 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
return ip4_config;
error:
+ if (addr)
+ g_free (addr);
+
g_object_unref (ip4_config);
+
return NULL;
}
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index 1b84a3a..9910f72 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -733,6 +733,17 @@ nm_ppp_manager_update_secrets (NMPPPManager *manager,
priv->pending_secrets_context = NULL;
}
+static gboolean
+ensure_killed (gpointer data)
+{
+ int pid = GPOINTER_TO_INT (data);
+
+ if (kill (pid, 0) == 0)
+ kill (pid, SIGKILL);
+
+ return FALSE;
+}
+
void
nm_ppp_manager_stop (NMPPPManager *manager)
{
@@ -753,7 +764,11 @@ nm_ppp_manager_stop (NMPPPManager *manager)
}
if (priv->pid) {
- kill (priv->pid, SIGTERM);
+ if (kill (priv->pid, SIGTERM) == 0)
+ g_timeout_add (2000, ensure_killed, GINT_TO_POINTER (priv->pid));
+ else
+ kill (priv->pid, SIGKILL);
+
priv->pid = 0;
}
}
--
1.5.4.5
++++++ 0005-Check-PIN-before-resetting-modem.patch ++++++
From 4eef751f296140a08aa131b1ebf54184b89fa207 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:00:45 +0300
Subject: [PATCH] Check PIN before resetting modem.
2008-05-28 Tambet Ingo
Patch from Dennis Noordsij .
* src/nm-gsm-device.c: Don't try to reset the modem before PIN is
checked, it doesn't work on some devices.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3696 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index 5234aad..c8428e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-05-28 Tambet Ingo
+ Patch from Dennis Noordsij .
+
+ * src/nm-gsm-device.c: Don't try to reset the modem before PIN is
+ checked, it doesn't work on some devices.
+
+2008-05-28 Tambet Ingo
+
* src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Make sure
pppd gets killed, if SIGTERM doesn't do it's job, SIGKILL it.
diff --git a/src/nm-gsm-device.c b/src/nm-gsm-device.c
index c57a75c..32b02fb 100644
--- a/src/nm-gsm-device.c
+++ b/src/nm-gsm-device.c
@@ -311,6 +311,49 @@ do_register (NMSerialDevice *device)
}
static void
+init_full_done (NMSerialDevice *device,
+ int reply_index,
+ gpointer user_data)
+{
+ gsm_device_set_pending (NM_GSM_DEVICE (device), 0);
+
+ switch (reply_index) {
+ case 0:
+ do_register (device);
+ break;
+ case -1:
+ nm_warning ("Modem second stage initialization timed out");
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ break;
+ default:
+ nm_warning ("Modem second stage initialization failed");
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ return;
+ }
+}
+
+static void
+init_modem_full (NMSerialDevice *device)
+{
+ guint id;
+ char *responses[] = { "OK", "ERROR", "ERR", NULL };
+
+ /* At this point we know that SIM has been unlocked, and we can safely
+ * initialize the modem
+ */
+ if (!nm_serial_device_send_command_string (device, "ATZ")) {
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ return;
+ }
+
+ id = nm_serial_device_wait_for_reply (device, 10, responses, responses, init_full_done, NULL);
+ if (id)
+ gsm_device_set_pending (NM_GSM_DEVICE (device), id);
+ else
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+}
+
+static void
enter_pin_done (NMSerialDevice *device,
int reply_index,
gpointer user_data)
@@ -318,10 +361,9 @@ enter_pin_done (NMSerialDevice *device,
NMSettingGsm *setting;
gsm_device_set_pending (NM_GSM_DEVICE (device), 0);
-
switch (reply_index) {
case 0:
- do_register (device);
+ init_modem_full (device);
break;
case -1:
nm_warning ("Did not receive response for secret");
@@ -484,8 +526,7 @@ init_modem (NMSerialDevice *device, gpointer user_data)
{
guint id;
char *responses[] = { "OK", "ERROR", "ERR", NULL };
-
- if (!nm_serial_device_send_command_string (device, "ATZ E0")) {
+ if (!nm_serial_device_send_command_string (device, "AT E0")) {
nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
return;
}
--
1.5.4.5
++++++ 0006-Reload-yast-settings-on-changes.patch ++++++
From 57fd77b593cab349aa97972d264b6ef50a86b8d2 Mon Sep 17 00:00:00 2001
From: tambeti
Date: Thu, 29 May 2008 07:57:52 +0000
Subject: [PATCH] Reload yast settings on changes.
2008-05-29 Tambet Ingo
* system-settings/plugins/ifcfg-suse/nm-suse-connection.c
(file_changed): Fix a bug where suse system settings plugin didn't
update the connections automatically when the files changed.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3700 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index c8428e8..e4afdfa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,46 @@
+2008-05-29 Tambet Ingo
+
+ * system-settings/plugins/ifcfg-suse/nm-suse-connection.c
+ (file_changed): Fix a bug where suse system settings plugin didn't
+ update the connections automatically when the files changed.
+
+2008-05-28 Dan Williams
+
+ Revert r3697 (adhoc-create property patch); it's the wrong way to do this.
+
+2008-05-28 Dan Williams
+
+ Patch from Benoit Boissinot
+
+ * src/NetworkManagerSystem.c
+ - (nm_system_device_flush_ip4_routes_with_iface): implement with libnl
+ - (nm_system_vpn_device_set_from_ip4_config): don't flush routes here,
+ was causing -EINVAL errors since the libnl code actually does flush
+ the routes on VPN interfaces now
+
+ * src/backends/NetworkManagerArch.c
+ src/backends/NetworkManagerDebian.c
+ src/backends/NetworkManagerFrugalware.c
+ src/backends/NetworkManagerGeneric.c
+ src/backends/NetworkManagerGentoo.c
+ src/backends/NetworkManagerMandriva.c
+ src/backends/NetworkManagerPaldo.c
+ src/backends/NetworkManagerRedHat.c
+ src/backends/NetworkManagerSlackware.c
+ src/backends/NetworkManagerSuSE.c
+ - (nm_system_device_flush_ip4_routes,
+ nm_system_device_flush_ip4_routes_with_iface): remove
+
+2008-05-28 Dan Williams
+
+ * libnm-util/nm-setting-wireless.c
+ libnm-util/nm-setting-wireless.h
+ - (set_property, get_property, nm_setting_wireless_class_init): add the
+ 'adhoc-create' property, which when TRUE indicates that NM should
+ create this connection as an adhoc wifi network if it's not found
+ as an adhoc network during scanning. Can be used to auto-create
+ adhoc networks when used in combination with autoconnect.
+
2008-05-28 Tambet Ingo
Patch from Dennis Noordsij .
diff --git a/system-settings/plugins/ifcfg-suse/nm-suse-connection.c b/system-settings/plugins/ifcfg-suse/nm-suse-connection.c
index b65a485..0929ac7 100644
--- a/system-settings/plugins/ifcfg-suse/nm-suse-connection.c
+++ b/system-settings/plugins/ifcfg-suse/nm-suse-connection.c
@@ -38,14 +38,16 @@ file_changed (GFileMonitor *monitor,
new_connection = parse_ifcfg (priv->iface, priv->dev_type);
if (new_connection) {
new_settings = nm_connection_to_hash (new_connection);
- nm_exported_connection_update (exported, new_settings, NULL);
+ nm_connection_replace_settings (nm_exported_connection_get_connection (exported), new_settings);
+ nm_exported_connection_signal_updated (exported, new_settings);
+
g_hash_table_destroy (new_settings);
g_object_unref (new_connection);
} else
- nm_exported_connection_delete (exported, NULL);
+ nm_exported_connection_signal_removed (exported);
break;
case G_FILE_MONITOR_EVENT_DELETED:
- nm_exported_connection_delete (exported, NULL);
+ nm_exported_connection_signal_removed (exported);
break;
default:
break;
--
1.5.4.5
++++++ 0007-Fix-memory-leaks.patch ++++++
From a3f8c11cab0ad2c4f0a5f8cea86ae3b482140a27 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:06:12 +0300
Subject: [PATCH] Fix memory leaks.
2008-06-09 Tambet Ingo
* src/dhcp-manager/nm-dhcp-manager.c (finalize): Free private members.
(nm_dhcp_device_destroy): Destroy the device options hash table.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3733 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Conflicts:
diff --git a/ChangeLog b/ChangeLog
index e4afdfa..2dc6f67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,59 @@
+2008-06-09 Tambet Ingo
+
+ * src/dhcp-manager/nm-dhcp-manager.c (finalize): Free private members.
+ (nm_dhcp_device_destroy): Destroy the device options hash table.
+
+2008-06-05 Tambet Ingo
+
+ Fix memory leaks.
+
+ * system-settings/src/nm-system-config-hal-manager.c (get_type_for_udi):
+ Free data returned from dbus method call.
+
+ * system-settings/src/nm-polkit-helpers.c (check_polkit_privileges):
+ dbus_g_method_get_sender() returns a duplicated string, free it
+ when done.
+ (check_polkit_privileges): Looks like policykit sometimes returns
+ error and non-null return value, don't leak errors in that case.
+
+ * system-settings/src/main.c (find_plugin): Don't leak existing
+ plugin names.
+ (load_stuff): Don't leak device list and list items.
+ (have_connection_for_device): Don't leak connection list.
+
+ * system-settings/plugins/keyfile/reader.c (read_one_setting_value):
+ Free the data received from g_keyfile_get_*.
+
+ * system-settings/plugins/ifcfg-suse/parser.c (READ_WEP_KEY): Free
+ the key when the security object is updated.
+
+ * src/supplicant-manager/nm-supplicant-interface.c (scan_results_cb):
+ Free data returned from dbus method call.
+ (iface_state_cb): Ditto.
+ (add_network_cb): Ditto.
+ (nm_supplicant_interface_add_cb): Don't make another copy of already
+ duplicated object path.
+ (nm_supplicant_interface_add_to_supplicant): Free the driver GValue
+ when done.
+
+ * src/supplicant-manager/nm-supplicant-config.c
+ (ADD_STRING_LIST_VAL): Fix a memory leak.
+
+ * src/nm-manager.c (free_get_settings_info): Free the allocated
+ memory slice.
+ (list_connections_cb): Free data returned from dbus method call.
+ (system_settings_get_unmanaged_devices_cb): Ditto.
+
+ * src/nm-device-802-11-wireless.c (device_cleanup): Free ssid.
+
+ * system-settings/plugins/ifcfg-suse/shvar.c (svCloseFile):
+ * system-settings/plugins/ifcfg-fedora/shvar.c (svCloseFile):
+ * src/backends/shvar.c (svCloseFile): Free the duplicated content
+ of the GList.
+
+ * libnm-util/nm-setting.c (nm_setting_from_hash): Free the constructor
+ arguments after the object is created.
+
2008-05-29 Tambet Ingo
* system-settings/plugins/ifcfg-suse/nm-suse-connection.c
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index eaa4983..5f77478 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -107,6 +107,7 @@ nm_setting_from_hash (GType setting_type,
{
NMSetting *setting;
NMSettingFromHashInfo info;
+ int i;
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (setting_type), NULL);
g_return_val_if_fail (hash != NULL, NULL);
@@ -119,6 +120,11 @@ nm_setting_from_hash (GType setting_type,
setting = (NMSetting *) g_object_newv (setting_type, info.n_params, info.params);
+ for (i = 0; i < info.n_params; i++) {
+ GValue *v = &info.params[i].value;
+ g_value_unset (v);
+ }
+
g_free (info.params);
g_type_class_unref (info.class);
diff --git a/src/backends/shvar.c b/src/backends/shvar.c
index c2d1b5a..83024b2 100644
--- a/src/backends/shvar.c
+++ b/src/backends/shvar.c
@@ -392,6 +392,7 @@ svCloseFile(shvarFile *s)
}
g_free(s->fileName);
g_list_free(s->freeList);
+ g_list_foreach (s->lineList, (GFunc) g_free, NULL);
g_list_free(s->lineList); /* implicitly frees s->current */
g_free(s);
return 0;
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index 732b969..6a4e02e 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -140,6 +140,12 @@ nm_dhcp_manager_init (NMDHCPManager *manager)
static void
finalize (GObject *object)
{
+ NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object);
+
+ g_hash_table_destroy (priv->devices);
+ g_object_unref (priv->proxy);
+ g_object_unref (priv->dbus_mgr);
+
G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->finalize (object);
}
@@ -211,7 +217,7 @@ nm_dhcp_device_destroy (NMDHCPDevice *device)
{
nm_dhcp_device_timeout_cleanup (device);
nm_dhcp_device_watch_cleanup (device);
- g_hash_table_remove_all (device->options);
+ g_hash_table_destroy (device->options);
g_free (device->iface);
g_slice_free (NMDHCPDevice, device);
}
diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c
index f41a4a5..31899c0 100644
--- a/src/nm-device-802-11-wireless.c
+++ b/src/nm-device-802-11-wireless.c
@@ -828,6 +828,12 @@ device_cleanup (NMDevice80211Wireless *self)
priv->supplicant.mgr = NULL;
}
+ if (priv->ssid) {
+ g_byte_array_free (priv->ssid, TRUE);
+ priv->ssid = NULL;
+ }
+
+
set_current_ap (self, NULL);
remove_all_aps (self);
}
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 29f4541..c84c08a 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -617,6 +617,7 @@ free_get_settings_info (gpointer data)
*(info->calls) = g_slist_remove (*(info->calls), info->call);
if (g_slist_length (*(info->calls)) == 0) {
g_slist_free (*(info->calls));
+ g_slice_free (GSList, (gpointer) info->calls);
g_signal_emit (info->manager,
signals[CONNECTIONS_ADDED],
0,
@@ -890,10 +891,10 @@ list_connections_cb (DBusGProxy *proxy,
calls = g_slice_new0 (GSList *);
for (i = 0; i < ops->len; i++) {
- internal_new_connection_cb (proxy,
- g_ptr_array_index (ops, i),
- manager,
- calls);
+ char *op = g_ptr_array_index (ops, i);
+
+ internal_new_connection_cb (proxy, op, manager, calls);
+ g_free (op);
}
g_ptr_array_free (ops, TRUE);
@@ -1059,10 +1060,11 @@ system_settings_get_unmanaged_devices_cb (DBusGProxy *proxy,
return;
}
- if (!G_VALUE_HOLDS (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH))
- return;
+ if (G_VALUE_HOLDS (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH))
+ handle_unmanaged_devices (manager, g_value_get_boxed (&value));
+
+ g_value_unset (&value);
- handle_unmanaged_devices (manager, g_value_get_boxed (&value));
g_object_unref (proxy);
}
diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c
index 23f563c..97f71bb 100644
--- a/src/supplicant-manager/nm-supplicant-config.c
+++ b/src/supplicant-manager/nm-supplicant-config.c
@@ -436,12 +436,10 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
g_string_append (str, elt->data); \
} \
} \
- value = g_strdup (str->str); \
if (ucase) \
- value = g_ascii_strup (str->str, -1); \
+ g_string_ascii_up (str); \
+ success = nm_supplicant_config_add_option (self, name, str->str, -1, secret); \
g_string_free (str, TRUE); \
- success = nm_supplicant_config_add_option (self, name, value, -1, secret); \
- g_free (value); \
if (!success) { \
nm_warning ("Error adding %s to supplicant config.", name); \
return FALSE; \
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c
index cb683fe..7a4c136 100644
--- a/src/supplicant-manager/nm-supplicant-interface.c
+++ b/src/supplicant-manager/nm-supplicant-interface.c
@@ -534,7 +534,10 @@ scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
/* Fire off a "properties" call for each returned BSSID */
for (i = 0; i < array->len; i++) {
- request_bssid_properties (info->interface, g_ptr_array_index (array, i));
+ char *op = g_ptr_array_index (array, i);
+
+ request_bssid_properties (info->interface, op);
+ g_free (op);
}
g_ptr_array_free (array, TRUE);
@@ -654,6 +657,7 @@ iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
NMSupplicantInfo *info = (NMSupplicantInfo *) user_data;
NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface)->con_state = wpas_state_string_to_enum (state_str);
+ g_free (state_str);
nm_supplicant_interface_set_state (info->interface,
NM_SUPPLICANT_INTERFACE_STATE_READY);
}
@@ -700,7 +704,7 @@ nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpoi
} else {
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface);
- priv->object_path = g_strdup (path);
+ priv->object_path = path;
priv->iface_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
WPAS_DBUS_SERVICE,
@@ -772,6 +776,8 @@ nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface * self,
DBUS_TYPE_G_MAP_OF_VARIANT, hash,
G_TYPE_INVALID);
+ g_value_unset (driver);
+ g_free (driver);
g_hash_table_destroy (hash);
}
@@ -1128,6 +1134,7 @@ add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
WPAS_DBUS_SERVICE,
path,
WPAS_DBUS_IFACE_NETWORK);
+ g_free (path);
info = nm_supplicant_info_new (info->interface,
priv->net_proxy,
diff --git a/system-settings/plugins/ifcfg-fedora/shvar.c b/system-settings/plugins/ifcfg-fedora/shvar.c
index c2d1b5a..83024b2 100644
--- a/system-settings/plugins/ifcfg-fedora/shvar.c
+++ b/system-settings/plugins/ifcfg-fedora/shvar.c
@@ -392,6 +392,7 @@ svCloseFile(shvarFile *s)
}
g_free(s->fileName);
g_list_free(s->freeList);
+ g_list_foreach (s->lineList, (GFunc) g_free, NULL);
g_list_free(s->lineList); /* implicitly frees s->current */
g_free(s);
return 0;
diff --git a/system-settings/plugins/ifcfg-suse/parser.c b/system-settings/plugins/ifcfg-suse/parser.c
index d2c7e20..276df4c 100644
--- a/system-settings/plugins/ifcfg-suse/parser.c
+++ b/system-settings/plugins/ifcfg-suse/parser.c
@@ -317,6 +317,7 @@ get_one_wep_key (shvarFile *ifcfg, guint8 idx, GError **err)
NM_SETTING_WIRELESS_SECURITY_WEP_KEY##idx, \
key, \
NULL); \
+ g_free (key); \
have_key = TRUE; \
} \
}
diff --git a/system-settings/plugins/ifcfg-suse/shvar.c b/system-settings/plugins/ifcfg-suse/shvar.c
index 85577ea..85f6490 100644
--- a/system-settings/plugins/ifcfg-suse/shvar.c
+++ b/system-settings/plugins/ifcfg-suse/shvar.c
@@ -396,6 +396,7 @@ svCloseFile(shvarFile *s)
}
g_free(s->fileName);
g_list_free(s->freeList);
+ g_list_foreach (s->lineList, (GFunc) g_free, NULL);
g_list_free(s->lineList); /* implicitly frees s->current */
g_free(s);
return 0;
diff --git a/system-settings/plugins/keyfile/reader.c b/system-settings/plugins/keyfile/reader.c
index 5c59bb2..0aa7be7 100644
--- a/system-settings/plugins/keyfile/reader.c
+++ b/system-settings/plugins/keyfile/reader.c
@@ -201,6 +201,7 @@ read_one_setting_value (NMSetting *setting,
tmp_str = g_key_file_get_value (file, setting->name, key, NULL);
uint_val = g_ascii_strtoull (tmp_str, NULL, 10);
+ g_free (tmp_str);
g_object_set (setting, key, uint_val, NULL);
} else if (type == DBUS_TYPE_G_UCHAR_ARRAY) {
gint *tmp;
@@ -223,6 +224,7 @@ read_one_setting_value (NMSetting *setting,
g_object_set (setting, key, array, NULL);
g_byte_array_free (array, TRUE);
+ g_free (tmp);
} else if (type == dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) {
gchar **sa;
gsize length;
diff --git a/system-settings/src/main.c b/system-settings/src/main.c
index 16eb325..0d0d087 100644
--- a/system-settings/src/main.c
+++ b/system-settings/src/main.c
@@ -83,22 +83,25 @@ static GObject *
find_plugin (GSList *list, const char *pname)
{
GSList *iter;
+ GObject *obj = NULL;
g_return_val_if_fail (pname != NULL, FALSE);
- for (iter = list; iter; iter = g_slist_next (iter)) {
+ for (iter = list; iter && !obj; iter = g_slist_next (iter)) {
NMSystemConfigInterface *plugin = NM_SYSTEM_CONFIG_INTERFACE (iter->data);
- char *list_pname;
+ char *list_pname = NULL;
g_object_get (G_OBJECT (plugin),
NM_SYSTEM_CONFIG_INTERFACE_NAME,
&list_pname,
NULL);
if (list_pname && !strcmp (pname, list_pname))
- return G_OBJECT (plugin);
+ obj = G_OBJECT (plugin);
+
+ g_free (list_pname);
}
- return NULL;
+ return obj;
}
static gboolean
@@ -176,8 +179,12 @@ load_stuff (gpointer user_data)
/* Grab wired devices to make default DHCP connections for them if needed */
devs = nm_system_config_hal_manager_get_devices_of_type (app->hal_mgr, DEVICE_TYPE_802_3_ETHERNET);
- for (iter = devs; iter; iter = g_slist_next (iter))
+ for (iter = devs; iter; iter = g_slist_next (iter)) {
device_added_cb (NULL, (const char *) iter->data, DEVICE_TYPE_802_3_ETHERNET, app);
+ g_free (iter->data);
+ }
+
+ g_slist_free (devs);
if (!start_dbus_service (app)) {
g_main_loop_quit (app->loop);
@@ -273,6 +280,7 @@ have_connection_for_device (Application *app, GByteArray *mac)
GSList *list, *iter;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
+ gboolean ret = FALSE;
g_return_val_if_fail (app != NULL, FALSE);
g_return_val_if_fail (mac != NULL, FALSE);
@@ -297,19 +305,28 @@ have_connection_for_device (Application *app, GByteArray *mac)
s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
/* No wired setting; therefore the PPPoE connection applies to any device */
- if (!s_wired && !strcmp (s_con->type, NM_SETTING_PPPOE_SETTING_NAME))
- return TRUE;
+ if (!s_wired && !strcmp (s_con->type, NM_SETTING_PPPOE_SETTING_NAME)) {
+ ret = TRUE;
+ break;
+ }
if (s_wired->mac_address) {
/* A connection mac-locked to this device */
- if (!memcmp (s_wired->mac_address->data, mac->data, ETH_ALEN))
- return TRUE;
+ if (!memcmp (s_wired->mac_address->data, mac->data, ETH_ALEN)) {
+ ret = TRUE;
+ break;
+ }
+
} else {
/* A connection that applies to any wired device */
- return TRUE;
+ ret = TRUE;
+ break;
}
}
- return FALSE;
+
+ g_slist_free (list);
+
+ return ret;
}
static gboolean
diff --git a/system-settings/src/nm-polkit-helpers.c b/system-settings/src/nm-polkit-helpers.c
index 3952f2d..7ac336c 100644
--- a/system-settings/src/nm-polkit-helpers.c
+++ b/system-settings/src/nm-polkit-helpers.c
@@ -103,7 +103,7 @@ check_polkit_privileges (DBusGConnection *dbus_connection,
GError **err)
{
DBusError dbus_error;
- const char *sender;
+ char *sender;
PolKitCaller *pk_caller;
PolKitAction *pk_action;
PolKitResult pk_result;
@@ -113,13 +113,17 @@ check_polkit_privileges (DBusGConnection *dbus_connection,
pk_caller = polkit_caller_new_from_dbus_name (dbus_g_connection_get_connection (dbus_connection),
sender,
&dbus_error);
- if (!pk_caller) {
+ g_free (sender);
+
+ if (dbus_error_is_set (&dbus_error)) {
*err = g_error_new (NM_SYSCONFIG_SETTINGS_ERROR,
NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED,
"Error getting information about caller: %s: %s",
dbus_error.name, dbus_error.message);
dbus_error_free (&dbus_error);
- polkit_caller_unref (pk_caller);
+
+ if (pk_caller)
+ polkit_caller_unref (pk_caller);
return FALSE;
}
diff --git a/system-settings/src/nm-system-config-hal-manager.c b/system-settings/src/nm-system-config-hal-manager.c
index 19342d2..686a8f0 100644
--- a/system-settings/src/nm-system-config-hal-manager.c
+++ b/system-settings/src/nm-system-config-hal-manager.c
@@ -97,6 +97,9 @@ get_type_for_udi (NMSystemConfigHalManager *manager, const char *udi)
else if (!strcmp (elt->data, "IS-707-A"))
devtype = DEVICE_TYPE_CDMA;
}
+
+ g_slist_foreach (csets, (GFunc) g_free, NULL);
+ g_slist_free (csets);
}
}
}
--
1.5.4.5
++++++ 0008-Show-default-device-in-nm-tool.patch ++++++
From 6f0a2504795bf1125eeabb0f56a39cf5be677c27 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:07:51 +0300
Subject: [PATCH] 2008-06-05 Dan Williams
Patch from Markus Becker
* test/nm-tool.c
- Show which device is the default device
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3723 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Conflicts:
ChangeLog
diff --git a/ChangeLog b/ChangeLog
index 2dc6f67..6f8a8f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-05 Dan Williams
+
+ Patch from Markus Becker
+
+ * test/nm-tool.c
+ - Show which device is the default device
+
2008-06-09 Tambet Ingo
* src/dhcp-manager/nm-dhcp-manager.c (finalize): Free private members.
diff --git a/test/nm-tool.c b/test/nm-tool.c
index d5a1ac3..4dfe2a8 100644
--- a/test/nm-tool.c
+++ b/test/nm-tool.c
@@ -198,11 +198,14 @@ static void
detail_device (gpointer data, gpointer user_data)
{
NMDevice *device = NM_DEVICE (data);
+ NMClient *client = NM_CLIENT (user_data);
char *tmp;
NMDeviceState state;
guint32 caps;
guint32 speed;
const GArray *array;
+ const GPtrArray *connections;
+ int j;
state = nm_device_get_state (device);
@@ -223,6 +226,22 @@ detail_device (gpointer data, gpointer user_data)
print_string ("State", get_dev_state_string (state));
+ connections = nm_client_get_active_connections (client);
+ for (j = 0; connections && (j < connections->len); j++) {
+ NMActiveConnection *candidate = g_ptr_array_index (connections, j);
+ const GPtrArray *devices = nm_active_connection_get_devices (candidate);
+ NMDevice *candidate_dev;
+
+ if (!devices || !devices->len)
+ continue;
+ candidate_dev = g_ptr_array_index (devices, 0);
+
+ if ((candidate_dev == device) && nm_active_connection_get_default(candidate))
+ print_string ("Default", "yes");
+ else
+ print_string ("Default", "no");
+ }
+
tmp = NULL;
if (NM_IS_DEVICE_802_3_ETHERNET (device))
tmp = g_strdup (nm_device_802_3_ethernet_get_hw_address (NM_DEVICE_802_3_ETHERNET (device)));
@@ -362,7 +381,7 @@ main (int argc, char *argv[])
}
devices = nm_client_get_devices (client);
- g_ptr_array_foreach ((GPtrArray *) devices, detail_device, NULL);
+ g_ptr_array_foreach ((GPtrArray *) devices, detail_device, client);
g_object_unref (client);
--
1.5.4.5
++++++ 0009-Fix-AP-reference-counting.patch ++++++
From 5ab783edd7d2d6cc4c1531d035f24d57fc490a70 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:09:25 +0300
Subject: [PATCH] Fix AP reference counting.
2008-06-09 Dan Williams
* libnm-glib/nm-device-802-11-wireless.c
- (access_point_removed_proxy): actually unref the AP after removing
it from the device's AP list. Fixes refcounting bug for APs that
caused them to get mixed up in the applet's menu.
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3734 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Conflicts:
ChangeLog
diff --git a/ChangeLog b/ChangeLog
index 6f8a8f3..db92a33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-09 Dan Williams
+
+ * libnm-glib/nm-device-802-11-wireless.c
+ - (access_point_removed_proxy): actually unref the AP after removing
+ it from the device's AP list. Fixes refcounting bug for APs that
+ caused them to get mixed up in the applet's menu.
+
2008-06-05 Dan Williams
Patch from Markus Becker
diff --git a/libnm-glib/nm-device-802-11-wireless.c b/libnm-glib/nm-device-802-11-wireless.c
index 500c16c..5957165 100644
--- a/libnm-glib/nm-device-802-11-wireless.c
+++ b/libnm-glib/nm-device-802-11-wireless.c
@@ -293,6 +293,7 @@ access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
if (ap) {
g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
g_ptr_array_remove (priv->aps, ap);
+ g_object_unref (G_OBJECT (ap));
}
}
--
1.5.4.5
++++++ 0010-Use-distro-specific-dhclient.conf-path.patch ++++++
From b7da8e9fcbe465cf8084a7f740268953eacad98d Mon Sep 17 00:00:00 2001
From: dcbw
Date: Tue, 10 Jun 2008 12:59:32 +0000
Subject: [PATCH] Use distro specific dhclient.conf path.
2008-06-10 Dan Williams
* configure.in
- Add TARGET_* define to config.h to distinguish distros
* src/dhcp-manager/nm-dhcp-manager.c
- (dhclient_run): use distro-specific path for dhclient config file
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3739 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
diff --git a/ChangeLog b/ChangeLog
index db92a33..b54f6ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-10 Dan Williams
+
+ * configure.in
+ - Add TARGET_* define to config.h to distinguish distros
+
+ * src/dhcp-manager/nm-dhcp-manager.c
+ - (dhclient_run): use distro-specific path for dhclient config file
+
2008-06-09 Dan Williams
* libnm-glib/nm-device-802-11-wireless.c
diff --git a/configure.in b/configure.in
index 096b85b..f98ad1c 100644
--- a/configure.in
+++ b/configure.in
@@ -105,15 +105,51 @@ else
;;
esac
fi
+
AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
+if test x"$with_distro" = xredhat; then
+ AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
+fi
+
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
+if test x"$with_distro" = xsuse; then
+ AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES])
+fi
+
AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
+if test x"$with_distro" = xgentoo; then
+ AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo])
+fi
+
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
+if test x"$with_distro" = xdebian; then
+ AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian])
+fi
+
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
+if test x"$with_distro" = xslackware; then
+ AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware])
+fi
+
AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
+if test x"$with_distro" = xarch; then
+ AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch])
+fi
+
AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
+if test x"$with_distro" = xpaldo; then
+ AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo])
+fi
+
AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
+if test x"$with_distro" = xfrugalware; then
+ AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware])
+fi
+
AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
+if test x"$with_distro" = xmandriva; then
+ AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva])
+fi
AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
AC_TRY_COMPILE([#ifndef __user
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index 6a4e02e..1c55686 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -55,6 +55,15 @@
#define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */
+#if defined(TARGET_SUSE)
+#define DHCLIENT_CONF_PATH SYSCONFDIR "/dhclient.conf"
+#elif defined(TARGET_DEBIAN)
+#define DHCLIENT_CONF_PATH SYSCONFDIR "/dhcp3/dhclient.conf"
+#else
+#define DHCLIENT_CONF_PATH_FORMAT SYSCONFDIR "/dhclient-%s.conf"
+#endif
+
+
static const char *dhclient_binary_paths[] =
{
"/sbin/dhclient",
@@ -636,7 +645,11 @@ dhclient_run (NMDHCPDevice *device)
goto out;
}
- conffile = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", device->iface);
+#ifdef DHCLIENT_CONF_PATH_FORMAT
+ conffile = g_strdup_printf (DHCLIENT_CONF_PATH_FORMAT, device->iface);
+#else
+ conffile = g_strdup (DHCLIENT_CONF_PATH);
+#endif
if (!conffile) {
nm_warning ("%s: not enough memory for dhclient options.", device->iface);
goto out;
--
1.5.4.5
++++++ 0011-Fix-setting-route-to-gateway-where-gateway-is-in-ano.patch ++++++
From c6c8c4fed1c01751681810739768810896a08168 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:16:06 +0300
Subject: [PATCH] Fix setting route to gateway where gateway is in another subnet.
diff --git a/src/NetworkManagerSystem.c b/src/NetworkManagerSystem.c
index 1287e57..2dba863 100644
--- a/src/NetworkManagerSystem.c
+++ b/src/NetworkManagerSystem.c
@@ -139,7 +139,7 @@ nm_system_device_set_ip4_route (const char *iface,
goto out;
}
- if (err != ESRCH) {
+ if (err != -ESRCH) {
nm_warning ("Failed to set IPv4 default route on '%s': %s",
iface,
nl_geterror ());
@@ -611,7 +611,7 @@ nm_system_device_replace_default_ip4_route (const char *iface, guint32 gw, guint
if (err == 0) {
/* Everything good */
goto out;
- } else if (err != ESRCH) {
+ } else if (err != -ESRCH) {
nm_warning ("rtnl_route_add() returned error %s (%d)\n%s",
strerror (err), err, nl_geterror());
goto out;
--
1.5.4.5
++++++ 0012-Use-user-provided-APN.patch ++++++
From a4d45287d376a0513a20820e96bd4ee471558270 Mon Sep 17 00:00:00 2001
From: Tambet Ingo
Date: Mon, 16 Jun 2008 13:18:16 +0300
Subject: [PATCH] Use user provided APN.
2008-06-11 Dan Williams
Patch from Tambet Ingo
* libnm-util/nm-setting-gsm.c
- (verify): validate APN
* src/nm-gsm-device.c
- (manual_registration_done): start setting APN if needed
- (set_apn, set_apn_done): set the APN
- (do_dial): use the APN when dialing
git-svn-id: svn+ssh://svn.gnome.org/svn/NetworkManager/trunk@3750 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Conflicts:
ChangeLog
diff --git a/ChangeLog b/ChangeLog
index b54f6ef..1660279 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-06-11 Dan Williams
+
+ Patch from Tambet Ingo
+
+ * libnm-util/nm-setting-gsm.c
+ - (verify): validate APN
+
+ * src/nm-gsm-device.c
+ - (manual_registration_done): start setting APN if needed
+ - (set_apn, set_apn_done): set the APN
+ - (do_dial): use the APN when dialing
+
2008-06-10 Dan Williams
* configure.in
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 2c60281..5bd2150 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -54,6 +54,11 @@ verify (NMSetting *setting, GSList *all_settings)
return FALSE;
}
+ if (self->apn && (strlen (self->apn) < 1 || strchr (self->apn, '"'))) {
+ nm_warning ("Invalid APN");
+ return FALSE;
+ }
+
return TRUE;
}
diff --git a/src/nm-gsm-device.c b/src/nm-gsm-device.c
index 32b02fb..6024e1e 100644
--- a/src/nm-gsm-device.c
+++ b/src/nm-gsm-device.c
@@ -130,7 +130,7 @@ dial_done (NMSerialDevice *device,
}
static void
-do_dial (NMSerialDevice *device)
+do_dial (NMSerialDevice *device, guint cid)
{
NMSettingGsm *setting;
char *command;
@@ -140,7 +140,20 @@ do_dial (NMSerialDevice *device)
setting = NM_SETTING_GSM (gsm_device_get_setting (NM_GSM_DEVICE (device), NM_TYPE_SETTING_GSM));
- command = g_strconcat ("ATDT", setting->number, NULL);
+ if (cid) {
+ GString *str;
+
+ str = g_string_new ("ATD");
+ if (g_str_has_suffix (setting->number, "#"))
+ str = g_string_append_len (str, setting->number, strlen (setting->number) - 1);
+ else
+ str = g_string_append (str, setting->number);
+
+ g_string_append_printf (str, "***%d#", cid);
+ command = g_string_free (str, FALSE);
+ } else
+ command = g_strconcat ("ATDT", setting->number, NULL);
+
success = nm_serial_device_send_command_string (device, command);
g_free (command);
@@ -156,6 +169,57 @@ do_dial (NMSerialDevice *device)
}
static void
+set_apn_done (NMSerialDevice *device,
+ int reply_index,
+ gpointer user_data)
+{
+ guint cid = GPOINTER_TO_UINT (user_data);
+
+ gsm_device_set_pending (NM_GSM_DEVICE (device), 0);
+
+ switch (reply_index) {
+ case 0:
+ do_dial (device, cid);
+ break;
+ default:
+ nm_warning ("Setting APN failed");
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ break;
+ }
+}
+
+static void
+set_apn (NMSerialDevice *device)
+{
+ NMSettingGsm *setting;
+ char *command;
+ char *responses[] = { "OK", "ERROR", NULL };
+ gboolean success;
+ guint id = 0;
+ guint cid = 1;
+
+ setting = NM_SETTING_GSM (gsm_device_get_setting (NM_GSM_DEVICE (device), NM_TYPE_SETTING_GSM));
+
+ if (!setting->apn) {
+ /* APN not set, nothing to do */
+ do_dial (device, 0);
+ return;
+ }
+
+ command = g_strdup_printf ("AT+CGDCONT=%d, \"IP\", \"%s\"", cid, setting->apn);
+ success = nm_serial_device_send_command_string (device, command);
+ g_free (command);
+
+ if (success)
+ id = nm_serial_device_wait_for_reply (device, 3, responses, responses, set_apn_done, GUINT_TO_POINTER (cid));
+
+ if (id)
+ gsm_device_set_pending (NM_GSM_DEVICE (device), id);
+ else
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+}
+
+static void
manual_registration_done (NMSerialDevice *device,
int reply_index,
gpointer user_data)
@@ -164,7 +228,7 @@ manual_registration_done (NMSerialDevice *device,
switch (reply_index) {
case 0:
- do_dial (device);
+ set_apn (device);
break;
case -1:
nm_warning ("Manual registration timed out");
@@ -215,7 +279,7 @@ get_network_done (NMSerialDevice *device,
else
nm_warning ("Couldn't read active network name");
- do_dial (device);
+ set_apn (device);
}
static void
--
1.5.4.5
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org