summaryrefslogtreecommitdiff
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2012-04-18 02:42:28 +0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-04-19 23:46:45 +0400
commitf0712e86b75f4839773abbc01d5baa7e36e378c2 (patch)
tree7f80147f312d1d7f683b4532d8669a831132246e /net/tipc/socket.c
parentd0e17fedc2aeb0c4db09434787ef6d432582e050 (diff)
downloadlinux-f0712e86b75f4839773abbc01d5baa7e36e378c2.tar.xz
tipc: Ensure network address change doesn't impact local connections
Revises routines that deal with connections between two ports on the same node to ensure the connection is not impacted if the node's network address is changed in mid-operation. The routines now treat the default node address of <0.0.0> as an alias for "this node" in the following situations: 1) Incoming messages destined to a connected port now handle the alias properly when validating that the message was sent by the expected peer port, ensuring that the message will be accepted regardless of whether it specifies the node's old network address or it's current one. 2) The code which completes connection establishment now handles the alias properly when determining if the peer port is on the same node as the connected port. An added benefit of addressing issue 1) is that some peer port validation code has been relocated to TIPC's socket subsystem, which means that validation is no longer done twice when a message is sent to a non-socket port (such as TIPC's configuration service or network topology service). Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index bcb3314ef164..c19fc4a228a8 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1236,7 +1236,8 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf)
if (msg_mcast(msg))
return TIPC_ERR_NO_PORT;
if (sock->state == SS_CONNECTED) {
- if (!msg_connected(msg))
+ if (!msg_connected(msg) ||
+ !tipc_port_peer_msg(tipc_sk_port(sk), msg))
return TIPC_ERR_NO_PORT;
} else if (sock->state == SS_CONNECTING) {
if (!msg_connected(msg) && (msg_errcode(msg) == 0))