Author: dcbw
Date: Fri Jan 18 03:01:44 2008
New Revision: 3245
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3245&view=rev

Log:
2008-01-17  Dan Williams  <[EMAIL PROTECTED]>

        * src/nm-device-802-3-ethernet.c
                - (nm_device_802_3_ethernet_carrier_on,
                   nm_device_802_3_ethernet_carrier_off): ignore any spurious 
netlink
                        carrier events that might come in for devices that 
don't support
                        carrier detect



Modified:
   trunk/ChangeLog
   trunk/src/nm-device-802-3-ethernet.c

Modified: trunk/src/nm-device-802-3-ethernet.c
==============================================================================
--- trunk/src/nm-device-802-3-ethernet.c        (original)
+++ trunk/src/nm-device-802-3-ethernet.c        Fri Jan 18 03:01:44 2008
@@ -84,10 +84,17 @@
                                      gpointer user_data)
 {
        NMDevice *dev = NM_DEVICE (user_data);
+       guint32 caps;
 
        /* Make sure signal is for us */
-       if (nm_netlink_iface_to_index (nm_device_get_iface (dev)) == idx)
+       if (nm_netlink_iface_to_index (nm_device_get_iface (dev)) == idx) {
+               /* Ignore spurious netlink messages */
+               caps = nm_device_get_capabilities (dev);
+               if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT))
+                       return;
+
                nm_device_set_active_link (dev, TRUE);
+       }
 }
 
 static void
@@ -96,10 +103,17 @@
                                       gpointer user_data)
 {
        NMDevice *dev = NM_DEVICE (user_data);
+       guint32 caps;
 
        /* Make sure signal is for us */
-       if (nm_netlink_iface_to_index (nm_device_get_iface (dev)) == idx)
+       if (nm_netlink_iface_to_index (nm_device_get_iface (dev)) == idx) {
+               /* Ignore spurious netlink messages */
+               caps = nm_device_get_capabilities (dev);
+               if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT))
+                       return;
+
                nm_device_set_active_link (dev, FALSE);
+       }
 }
 
 static GObject*
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to