device: do nothing in NMDevice's link_changed() function
All implementations of link_changed() chain up to NMDevice's base implementation. Thus, everybody wants to set the carrier. Refactor the code to set the carrier outside of link_changed().
This commit is contained in:
@@ -1981,7 +1981,11 @@ device_link_changed (NMDevice *self)
|
||||
_LOGD (LOGD_DEVICE, "IPv6 tokenized identifier present on device %s", priv->iface);
|
||||
}
|
||||
|
||||
if (klass->link_changed)
|
||||
/* Update carrier from link event if applicable. */
|
||||
if ( nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)
|
||||
&& !nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER))
|
||||
nm_device_set_carrier (self, pllink->connected);
|
||||
|
||||
klass->link_changed (self, &info);
|
||||
|
||||
/* Update DHCP, etc, if needed */
|
||||
@@ -2121,10 +2125,7 @@ link_changed_cb (NMPlatform *platform,
|
||||
static void
|
||||
link_changed (NMDevice *self, const NMPlatformLink *pllink)
|
||||
{
|
||||
/* Update carrier from link event if applicable. */
|
||||
if ( nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)
|
||||
&& !nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER))
|
||||
nm_device_set_carrier (self, pllink->connected);
|
||||
/* stub implementation of virtual function to allow subclasses to chain up. */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user