2008-01-18 Dan Williams <dcbw@redhat.com>
* src/nm-device-802-3-ethernet.c - (find_best_connection): check MAC address too - (real_get_best_connection): let autoconnect=True connections activate for devices that don't have carrier detection * src/nm-device-802-11-wireless.c - (find_best_connection): check MAC address too git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3248 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
|||||||
|
2008-01-18 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* src/nm-device-802-3-ethernet.c
|
||||||
|
- (find_best_connection): check MAC address too
|
||||||
|
- (real_get_best_connection): let autoconnect=True connections activate
|
||||||
|
for devices that don't have carrier detection
|
||||||
|
|
||||||
|
* src/nm-device-802-11-wireless.c
|
||||||
|
- (find_best_connection): check MAC address too
|
||||||
|
|
||||||
2008-01-18 Dan Williams <dcbw@redhat.com>
|
2008-01-18 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* system-settings/plugins/ifcfg/parser.c
|
* system-settings/plugins/ifcfg/parser.c
|
||||||
|
@@ -845,19 +845,20 @@ real_check_connection_conflicts (NMDevice *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef struct BestConnectionInfo {
|
typedef struct BestConnectionInfo {
|
||||||
NMDevice80211Wireless * self;
|
NMDevice80211Wireless *self;
|
||||||
NMConnection * found;
|
NMConnection *found;
|
||||||
NMAccessPoint * found_ap;
|
NMAccessPoint *found_ap;
|
||||||
} BestConnectionInfo;
|
} BestConnectionInfo;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_best_connection (gpointer data, gpointer user_data)
|
find_best_connection (gpointer data, gpointer user_data)
|
||||||
{
|
{
|
||||||
BestConnectionInfo * info = (BestConnectionInfo *) user_data;
|
BestConnectionInfo *info = (BestConnectionInfo *) user_data;
|
||||||
|
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (info->self);
|
||||||
NMConnection *connection = NM_CONNECTION (data);
|
NMConnection *connection = NM_CONNECTION (data);
|
||||||
NMSettingConnection * s_con;
|
NMSettingConnection *s_con;
|
||||||
NMSettingWireless * s_wireless;
|
NMSettingWireless *s_wireless;
|
||||||
GSList * elt;
|
GSList *elt;
|
||||||
|
|
||||||
if (info->found)
|
if (info->found)
|
||||||
return;
|
return;
|
||||||
@@ -871,8 +872,12 @@ find_best_connection (gpointer data, gpointer user_data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS);
|
s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS);
|
||||||
if (s_wireless == NULL)
|
g_return_if_fail (s_wireless != NULL);
|
||||||
|
|
||||||
|
if (s_wireless->mac_address) {
|
||||||
|
if (memcmp (s_wireless->mac_address->data, priv->hw_addr.ether_addr_octet, ETH_ALEN))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (elt = info->self->priv->ap_list; elt; elt = g_slist_next (elt)) {
|
for (elt = info->self->priv->ap_list; elt; elt = g_slist_next (elt)) {
|
||||||
NMAccessPoint *ap = NM_AP (elt->data);
|
NMAccessPoint *ap = NM_AP (elt->data);
|
||||||
|
@@ -342,17 +342,18 @@ real_can_interrupt_activation (NMDevice *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef struct BestConnectionInfo {
|
typedef struct BestConnectionInfo {
|
||||||
NMDevice8023Ethernet * self;
|
NMDevice8023Ethernet *self;
|
||||||
NMConnection * found;
|
NMConnection *found;
|
||||||
} BestConnectionInfo;
|
} BestConnectionInfo;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_best_connection (gpointer data, gpointer user_data)
|
find_best_connection (gpointer data, gpointer user_data)
|
||||||
{
|
{
|
||||||
BestConnectionInfo * info = (BestConnectionInfo *) user_data;
|
BestConnectionInfo *info = (BestConnectionInfo *) user_data;
|
||||||
|
NMDevice8023EthernetPrivate *priv = NM_DEVICE_802_3_ETHERNET_GET_PRIVATE (info->self);
|
||||||
NMConnection *connection = NM_CONNECTION (data);
|
NMConnection *connection = NM_CONNECTION (data);
|
||||||
NMSettingConnection * s_con;
|
NMSettingConnection *s_con;
|
||||||
NMSettingWired * s_wired;
|
NMSettingWired *s_wired;
|
||||||
|
|
||||||
if (info->found)
|
if (info->found)
|
||||||
return;
|
return;
|
||||||
@@ -366,8 +367,12 @@ find_best_connection (gpointer data, gpointer user_data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
|
s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
|
||||||
if (s_wired == NULL)
|
g_return_if_fail (s_wired != NULL);
|
||||||
|
|
||||||
|
if (s_wired->mac_address) {
|
||||||
|
if (memcmp (s_wired->mac_address->data, priv->hw_addr.ether_addr_octet, ETH_ALEN))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
info->found = connection;
|
info->found = connection;
|
||||||
}
|
}
|
||||||
@@ -379,17 +384,6 @@ real_get_best_connection (NMDevice *dev,
|
|||||||
{
|
{
|
||||||
NMDevice8023Ethernet * self = NM_DEVICE_802_3_ETHERNET (dev);
|
NMDevice8023Ethernet * self = NM_DEVICE_802_3_ETHERNET (dev);
|
||||||
BestConnectionInfo find_info;
|
BestConnectionInfo find_info;
|
||||||
guint32 caps;
|
|
||||||
|
|
||||||
caps = nm_device_get_capabilities (dev);
|
|
||||||
|
|
||||||
/* FIXME: for now, non-carrier-detect devices don't have a best connection,
|
|
||||||
* the user needs to pick one. In the near-future, we want to instead
|
|
||||||
* honor the first 'autoconnect':True connection we find that applies
|
|
||||||
* to this device.
|
|
||||||
*/
|
|
||||||
if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memset (&find_info, 0, sizeof (BestConnectionInfo));
|
memset (&find_info, 0, sizeof (BestConnectionInfo));
|
||||||
find_info.self = self;
|
find_info.self = self;
|
||||||
|
Reference in New Issue
Block a user