diff options
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r-- | net/bridge/br_if.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index c03d2c3ff03..89ad25a7620 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -61,30 +61,27 @@ static int port_cost(struct net_device *dev) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | /* | 64 | /* Check for port carrier transistions. */ |
65 | * Check for port carrier transistions. | ||
66 | * Called from work queue to allow for calling functions that | ||
67 | * might sleep (such as speed check), and to debounce. | ||
68 | */ | ||
69 | void br_port_carrier_check(struct net_bridge_port *p) | 65 | void br_port_carrier_check(struct net_bridge_port *p) |
70 | { | 66 | { |
71 | struct net_device *dev = p->dev; | 67 | struct net_device *dev = p->dev; |
72 | struct net_bridge *br = p->br; | 68 | struct net_bridge *br = p->br; |
73 | 69 | ||
74 | if (netif_carrier_ok(dev)) | 70 | if (netif_running(dev) && netif_carrier_ok(dev)) |
75 | p->path_cost = port_cost(dev); | 71 | p->path_cost = port_cost(dev); |
76 | 72 | ||
77 | if (netif_running(br->dev)) { | 73 | if (!netif_running(br->dev)) |
78 | spin_lock_bh(&br->lock); | 74 | return; |
79 | if (netif_carrier_ok(dev)) { | 75 | |
80 | if (p->state == BR_STATE_DISABLED) | 76 | spin_lock_bh(&br->lock); |
81 | br_stp_enable_port(p); | 77 | if (netif_running(dev) && netif_carrier_ok(dev)) { |
82 | } else { | 78 | if (p->state == BR_STATE_DISABLED) |
83 | if (p->state != BR_STATE_DISABLED) | 79 | br_stp_enable_port(p); |
84 | br_stp_disable_port(p); | 80 | } else { |
85 | } | 81 | if (p->state != BR_STATE_DISABLED) |
86 | spin_unlock_bh(&br->lock); | 82 | br_stp_disable_port(p); |
87 | } | 83 | } |
84 | spin_unlock_bh(&br->lock); | ||
88 | } | 85 | } |
89 | 86 | ||
90 | static void release_nbp(struct kobject *kobj) | 87 | static void release_nbp(struct kobject *kobj) |