aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/link_watch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index bf8f7af699d7..1e401e12dc72 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -178,7 +178,6 @@ static void __linkwatch_run_queue(int urgent_only)
178 */ 178 */
179 clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state); 179 clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state);
180 180
181 rfc2863_policy(dev);
182 if (dev->flags & IFF_UP) { 181 if (dev->flags & IFF_UP) {
183 if (netif_carrier_ok(dev)) 182 if (netif_carrier_ok(dev))
184 dev_activate(dev); 183 dev_activate(dev);
@@ -215,6 +214,12 @@ void linkwatch_fire_event(struct net_device *dev)
215{ 214{
216 bool urgent = linkwatch_urgent_event(dev); 215 bool urgent = linkwatch_urgent_event(dev);
217 216
217 rfc2863_policy(dev);
218
219 /* Some drivers call netif_carrier_off early */
220 if (dev->reg_state == NETREG_UNINITIALIZED)
221 return;
222
218 if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { 223 if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) {
219 dev_hold(dev); 224 dev_hold(dev);
220 225