aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-03-28 05:32:08 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-28 14:46:29 -0400
commita21a584d6720ce349b05795b9bcfab3de8e58419 (patch)
treeae61966b3e5ea3845959a2e506c2cd6390081091 /net/tipc
parentc8c3d7e2449a9e63c3cb72d24cebe956229af427 (diff)
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')
-rw-r--r--net/tipc/bearer.c7
-rw-r--r--net/tipc/bearer.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index ed45f9717af1..3cd65d46b173 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -332,6 +332,7 @@ restart:
332 b_ptr->identity = bearer_id; 332 b_ptr->identity = bearer_id;
333 b_ptr->tolerance = m_ptr->tolerance; 333 b_ptr->tolerance = m_ptr->tolerance;
334 b_ptr->window = m_ptr->window; 334 b_ptr->window = m_ptr->window;
335 b_ptr->domain = disc_domain;
335 b_ptr->net_plane = bearer_id + 'A'; 336 b_ptr->net_plane = bearer_id + 'A';
336 b_ptr->priority = priority; 337 b_ptr->priority = priority;
337 338
@@ -360,7 +361,9 @@ static int tipc_reset_bearer(struct tipc_bearer *b_ptr)
360{ 361{
361 read_lock_bh(&tipc_net_lock); 362 read_lock_bh(&tipc_net_lock);
362 pr_info("Resetting bearer <%s>\n", b_ptr->name); 363 pr_info("Resetting bearer <%s>\n", b_ptr->name);
364 tipc_disc_delete(b_ptr->link_req);
363 tipc_link_reset_list(b_ptr->identity); 365 tipc_link_reset_list(b_ptr->identity);
366 tipc_disc_create(b_ptr, &b_ptr->bcast_addr, b_ptr->domain);
364 read_unlock_bh(&tipc_net_lock); 367 read_unlock_bh(&tipc_net_lock);
365 return 0; 368 return 0;
366} 369}
@@ -580,7 +583,11 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
580 break; 583 break;
581 case NETDEV_DOWN: 584 case NETDEV_DOWN:
582 case NETDEV_CHANGEMTU: 585 case NETDEV_CHANGEMTU:
586 tipc_reset_bearer(b_ptr);
587 break;
583 case NETDEV_CHANGEADDR: 588 case NETDEV_CHANGEADDR:
589 tipc_l2_media_addr_set(b_ptr, &b_ptr->addr,
590 (char *)dev->dev_addr);
584 tipc_reset_bearer(b_ptr); 591 tipc_reset_bearer(b_ptr);
585 break; 592 break;
586 case NETDEV_UNREGISTER: 593 case NETDEV_UNREGISTER:
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 3f6d7d0f059b..ba48145e871d 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -116,6 +116,7 @@ struct tipc_media {
116 * @priority: default link priority for bearer 116 * @priority: default link priority for bearer
117 * @window: default window size for bearer 117 * @window: default window size for bearer
118 * @tolerance: default link tolerance for bearer 118 * @tolerance: default link tolerance for bearer
119 * @domain: network domain to which links can be established
119 * @identity: array index of this bearer within TIPC bearer array 120 * @identity: array index of this bearer within TIPC bearer array
120 * @link_req: ptr to (optional) structure making periodic link setup requests 121 * @link_req: ptr to (optional) structure making periodic link setup requests
121 * @net_plane: network plane ('A' through 'H') currently associated with bearer 122 * @net_plane: network plane ('A' through 'H') currently associated with bearer
@@ -135,6 +136,7 @@ struct tipc_bearer {
135 u32 priority; 136 u32 priority;
136 u32 window; 137 u32 window;
137 u32 tolerance; 138 u32 tolerance;
139 u32 domain;
138 u32 identity; 140 u32 identity;
139 struct tipc_link_req *link_req; 141 struct tipc_link_req *link_req;
140 char net_plane; 142 char net_plane;