summaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-03-22 15:42:47 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-23 13:12:18 -0400
commit2026364149db36c6a2c0c8cae8362fe9a7f954dd (patch)
tree267dc296fc385f53a8bd9537c9ac8193ea4b5663 /net/tipc/link.c
parentb39e465e56ec38ca64b4c0affeb6411eb0ed7267 (diff)
tipc: remove restrictions on node address values
Nominally, TIPC organizes network nodes into a three-level network hierarchy consisting of the levels 'zone', 'cluster' and 'node'. This hierarchy is reflected in the node address format, - it is sub-divided into an 8-bit zone id, and 12 bit cluster id, and a 12-bit node id. However, the 'zone' and 'cluster' levels have in reality never been fully implemented,and never will be. The result of this has been that the first 20 bits the node identity structure have been wasted, and the usable node identity range within a cluster has been limited to 12 bits. This is starting to become a problem. In the following commits, we will need to be able to connect between nodes which are using the whole 32-bit value space of the node address. We therefore remove the restrictions on which values can be assigned to node identity, -it is from now on only a 32-bit integer with no assumed internal structure. Isolation between clusters is now achieved only by setting different values for the 'network id' field used during neighbor discovery, in practice leading to the latter becoming the new cluster identity. The rules for accepting discovery requests/responses from neighboring nodes now become: - If the user is using legacy address format on both peers, reception of discovery messages is subject to the legacy lookup domain check in addition to the cluster id check. - Otherwise, the discovery request/response is always accepted, provided both peers have the same network id. This secures backwards compatibility for users who have been using zone or cluster identities as cluster separators, instead of the intended 'network id'. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 3c230466804d..86fde005ea47 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -434,7 +434,7 @@ char *tipc_link_name(struct tipc_link *l)
434 */ 434 */
435bool tipc_link_create(struct net *net, char *if_name, int bearer_id, 435bool tipc_link_create(struct net *net, char *if_name, int bearer_id,
436 int tolerance, char net_plane, u32 mtu, int priority, 436 int tolerance, char net_plane, u32 mtu, int priority,
437 int window, u32 session, u32 ownnode, u32 peer, 437 int window, u32 session, u32 self, u32 peer,
438 u16 peer_caps, 438 u16 peer_caps,
439 struct tipc_link *bc_sndlink, 439 struct tipc_link *bc_sndlink,
440 struct tipc_link *bc_rcvlink, 440 struct tipc_link *bc_rcvlink,
@@ -451,9 +451,7 @@ bool tipc_link_create(struct net *net, char *if_name, int bearer_id,
451 l->session = session; 451 l->session = session;
452 452
453 /* Note: peer i/f name is completed by reset/activate message */ 453 /* Note: peer i/f name is completed by reset/activate message */
454 sprintf(l->name, "%u.%u.%u:%s-%u.%u.%u:unknown", 454 sprintf(l->name, "%x:%s-%x:unknown", self, if_name, peer);
455 tipc_zone(ownnode), tipc_cluster(ownnode), tipc_node(ownnode),
456 if_name, tipc_zone(peer), tipc_cluster(peer), tipc_node(peer));
457 strcpy(l->if_name, if_name); 455 strcpy(l->if_name, if_name);
458 l->addr = peer; 456 l->addr = peer;
459 l->peer_caps = peer_caps; 457 l->peer_caps = peer_caps;