network-manager-applet r645 - in trunk: . src/utils
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: network-manager-applet r645 - in trunk: . src/utils
- Date: Wed, 2 Apr 2008 18:47:06 +0100 (BST)
Author: dcbw
Date: Wed Apr 2 18:47:06 2008
New Revision: 645
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=645&view=rev
Log:
2008-04-02 Dan Williams <dcbw redhat com>
* src/utils/utils.c
- (connection_valid_for_wired): handle PPPoE connections & devices
correctly
Modified:
trunk/ChangeLog
trunk/src/utils/utils.c
Modified: trunk/src/utils/utils.c
==============================================================================
--- trunk/src/utils/utils.c (original)
+++ trunk/src/utils/utils.c Wed Apr 2 18:47:06 2008
@@ -538,28 +538,32 @@
NMSettingWired *s_wired;
const char *str_mac;
struct ether_addr *bin_mac;
+ gboolean is_pppoe = FALSE;
if (!strcmp (s_con->type, NM_SETTING_PPPOE_SETTING_NAME))
- return TRUE;
+ is_pppoe = TRUE;
- if (strcmp (s_con->type, NM_SETTING_WIRED_SETTING_NAME))
+ if (!is_pppoe && strcmp (s_con->type, NM_SETTING_WIRED_SETTING_NAME))
return FALSE;
s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED));
- g_return_val_if_fail (s_wired != NULL, FALSE);
+ if (!is_pppoe && !s_wired)
+ return FALSE;
- /* Match MAC address */
- if (!s_wired->mac_address)
- return TRUE;
+ if (s_wired) {
+ /* Match MAC address */
+ if (!s_wired->mac_address)
+ return TRUE;
- str_mac = nm_device_802_3_ethernet_get_hw_address (ethdev);
- g_return_val_if_fail (str_mac != NULL, FALSE);
+ str_mac = nm_device_802_3_ethernet_get_hw_address (ethdev);
+ g_return_val_if_fail (str_mac != NULL, FALSE);
- bin_mac = ether_aton (str_mac);
- g_return_val_if_fail (bin_mac != NULL, FALSE);
+ bin_mac = ether_aton (str_mac);
+ g_return_val_if_fail (bin_mac != NULL, FALSE);
- if (memcmp (bin_mac->ether_addr_octet, s_wired->mac_address->data, ETH_ALEN))
- return FALSE;
+ if (memcmp (bin_mac->ether_addr_octet, s_wired->mac_address->data, ETH_ALEN))
+ return FALSE;
+ }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]