Skip to contentSkip to conversation

tipc: fix wrong publisher node address in link publications

net Applied [email protected] 3 participants 3 messages Feb 14, 2022 – Feb 15, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

From: Jon Maloy <[email protected]>

When a link comes up we add its presence to the name table to make it possible for users to subscribe for link up/down events. However, after a previous call signature change the binding is wrongly published with the peer node as publishing node, instead of the own node as it should be. This has the effect that the command 'tipc name table show' will list the link binding (service type 2) with node scope and a peer node as originator, something that obviously is impossible.

We correct this bug here.

Fixes 50a3499ab853 ("tipc: simplify signature of tipc_namtbl_publish()")
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/node.c +1 -1
index 9947b7dfe1d2..fd95df338da7 100644
@@ -413,7 +413,7 @@ static void tipc_node_write_unlock(struct tipc_node *n)
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE,
 		   TIPC_LINK_STATE, n->addr, n->addr);
 	sk.ref = n->link_id;
-	sk.node = n->addr;
+	sk.node = tipc_own_addr(net);
 	bearer_id = n->link_id & 0xffff;
 	publ_list = &n->publ_list;
 
Signature · 1 line
2.31.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Sun, 13 Feb 2022 20:38:52 -0500 you wrote:

From: Jon Maloy <[email protected]>

When a link comes up we add its presence to the name table to make it possible for users to subscribe for link up/down events. However, after a previous call signature change the binding is wrongly published with the peer node as publishing node, instead of the own node as it should be. This has the effect that the command 'tipc name table show' will list the link binding (service type 2) with node scope and a peer node as originator, something that obviously is impossible.

[...]

Here is the summary with links:
- [net] tipc: fix wrong publisher node address in link publications

    https://git.kernel.org/netdev/net/c/032062f363b4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to [email protected]

Hi Jon,

It seems this fix caused a problem with user type service as its always treated as node scope. The sending side does not know a service binding on peer node as it looks up on itself node address.

Regards,
Hoang

Quoted 43 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, February 14, 2022 8:39 AM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; Tung Quang Nguyen <[email protected]>; Hoang Huu Le <[email protected]>; Tuong Tong Lien <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [net] tipc: fix wrong publisher node address in link publications

From: Jon Maloy <[email protected]>

When a link comes up we add its presence to the name table to make it possible for users to subscribe for link up/down events. However, after a previous call signature change the binding is wrongly published with the peer node as publishing node, instead of the own node as it should be. This has the effect that the command 'tipc name table show' will list the link binding (service type 2) with node scope and a peer node as originator, something that obviously is impossible.

We correct this bug here.

Fixes 50a3499ab853 ("tipc: simplify signature of tipc_namtbl_publish()")
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/node.c +1 -2
index 9947b7dfe1d2..fd95df338da7 100644
@@ -413,7 +413,7 @@ static void tipc_node_write_unlock(struct tipc_node *n)
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE,
 		   TIPC_LINK_STATE, n->addr, n->addr);
 	sk.ref = n->link_id;
-	sk.node = n->addr;
+	sk.node = tipc_own_addr(net);
 	bearer_id = n->link_id & 0xffff;
 	publ_list = &n->publ_list;
 
--

2.31.1