Skip to content

Commit

Permalink
tipc: reset bearer if device carrier not ok
Browse files Browse the repository at this point in the history
If we detect that under lying carrier detects errors and goes down,
we reset the bearer.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Parthasarathy Bhuvaragan authored and davem330 committed Sep 26, 2018
1 parent 92ef12b commit 94b6ddc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,16 +609,18 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,

switch (evt) {
case NETDEV_CHANGE:
if (netif_carrier_ok(dev))
if (netif_carrier_ok(dev) && netif_oper_up(dev)) {
test_and_set_bit_lock(0, &b->up);
break;
/* else: fall through */
case NETDEV_UP:
test_and_set_bit_lock(0, &b->up);
break;
}
/* fall through */
case NETDEV_GOING_DOWN:
clear_bit_unlock(0, &b->up);
tipc_reset_bearer(net, b);
break;
case NETDEV_UP:
test_and_set_bit_lock(0, &b->up);
break;
case NETDEV_CHANGEMTU:
if (tipc_mtu_bad(dev, 0)) {
bearer_disable(net, b);
Expand Down

0 comments on commit 94b6ddc

Please sign in to comment.