From 6f22c03c1babe04794e9a727ec96e242b72ef83b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 2 Jul 2008 12:46:45 +0000 Subject: [PATCH] 2008-07-02 Dan Williams * src/nm-device-wifi.c - (can_scan): don't scan when a shared connection is activated since that makes drivers mad (causing disconnects); also NM doesn't need to hedge against disconnects by keeping up-to-date network topology because the connection originates from the local machine, and thus there should be no disconnects git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3796 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 9 +++++++++ src/nm-device-wifi.c | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3f0b41069b..847741498d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-02 Dan Williams + + * src/nm-device-wifi.c + - (can_scan): don't scan when a shared connection is activated since + that makes drivers mad (causing disconnects); also NM doesn't need + to hedge against disconnects by keeping up-to-date network topology + because the connection originates from the local machine, and thus + there should be no disconnects + 2008-07-01 Dan Williams Fix mobile broadband username/password issues. NM was never requesting diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 29a2ba7621..b9fa57565d 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -48,6 +48,8 @@ #include "nm-setting-wireless.h" #include "nm-setting-wireless-security.h" #include "nm-setting-8021x.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" #include "NetworkManagerSystem.h" static gboolean impl_device_get_access_points (NMDeviceWifi *device, @@ -1538,6 +1540,7 @@ can_scan (NMDeviceWifi *self) guint32 sup_state; NMDeviceState dev_state; gboolean is_disconnected = FALSE; + NMActRequest *req; g_return_val_if_fail (priv->supplicant.iface != NULL, FALSE); @@ -1558,6 +1561,23 @@ can_scan (NMDeviceWifi *self) if (is_disconnected) return TRUE; + /* Don't scan when a shared connection is active; it makes drivers mad */ + req = nm_device_get_act_request (NM_DEVICE (self)); + if (req) { + NMConnection *connection; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + + connection = nm_act_request_get_connection (req); + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) + return FALSE; + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6 && !strcmp (s_ip6->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) + return FALSE; + } + /* Devices supporting only B/G frequencies can scan when disconnected * and activated, but not when activating. We don't allow a/b/g devices to * scan when activated, because there are just too many channels to scan and