summaryrefslogtreecommitdiffstats
path: root/net/tipc/bearer.c
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-03-28 10:32:08 +0100
committerDavid S. Miller <davem@davemloft.net>2014-03-28 14:46:29 -0400
commita21a584d6720ce349b05795b9bcfab3de8e58419 (patch)
treeae61966b3e5ea3845959a2e506c2cd6390081091 /net/tipc/bearer.c
parentc8c3d7e2449a9e63c3cb72d24cebe956229af427 (diff)
downloadop-kernel-dev-a21a584d6720ce349b05795b9bcfab3de8e58419.zip
op-kernel-dev-a21a584d6720ce349b05795b9bcfab3de8e58419.tar.gz
tipc: fix neighbor detection problem after hw address change
If the hardware address of a underlying netdevice is changed, it is not enough to simply reset the bearer/links over this device. We also need to reflect this change in the TIPC bearer and node discovery structures aswell. This patch adds the necessary reinitialization of the node disovery mechanism following a hardware address change so that the correct originating media address is advertised in the discovery messages. Signed-off-by: Erik Hugne <erik.hugne@ericsson.com> Reported-by: Dong Liu <dliu.cn@gmail.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r--net/tipc/bearer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index ed45f97..3cd65d4 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -332,6 +332,7 @@ restart:
b_ptr->identity = bearer_id;
b_ptr->tolerance = m_ptr->tolerance;
b_ptr->window = m_ptr->window;
+ b_ptr->domain = disc_domain;
b_ptr->net_plane = bearer_id + 'A';
b_ptr->priority = priority;
@@ -360,7 +361,9 @@ static int tipc_reset_bearer(struct tipc_bearer *b_ptr)
{
read_lock_bh(&tipc_net_lock);
pr_info("Resetting bearer <%s>\n", b_ptr->name);
+ tipc_disc_delete(b_ptr->link_req);
tipc_link_reset_list(b_ptr->identity);
+ tipc_disc_create(b_ptr, &b_ptr->bcast_addr, b_ptr->domain);
read_unlock_bh(&tipc_net_lock);
return 0;
}
@@ -580,7 +583,11 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
break;
case NETDEV_DOWN:
case NETDEV_CHANGEMTU:
+ tipc_reset_bearer(b_ptr);
+ break;
case NETDEV_CHANGEADDR:
+ tipc_l2_media_addr_set(b_ptr, &b_ptr->addr,
+ (char *)dev->dev_addr);
tipc_reset_bearer(b_ptr);
break;
case NETDEV_UNREGISTER:
OpenPOWER on IntegriCloud