Commit 66bc1e8d authored by Erik Hugne's avatar Erik Hugne Committed by David S. Miller

tipc: allow rdm/dgram socketpairs

for socketpairs using connectionless transport, we cache
the respective node local TIPC portid to use in subsequent
calls to send() in the socket's private data.
Signed-off-by: default avatarErik Hugne <erik.hugne@gmail.com>
Signed-off-by: default avatarParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70b03759
...@@ -2515,9 +2515,21 @@ static int tipc_socketpair(struct socket *sock1, struct socket *sock2) ...@@ -2515,9 +2515,21 @@ static int tipc_socketpair(struct socket *sock1, struct socket *sock2)
{ {
struct tipc_sock *tsk2 = tipc_sk(sock2->sk); struct tipc_sock *tsk2 = tipc_sk(sock2->sk);
struct tipc_sock *tsk1 = tipc_sk(sock1->sk); struct tipc_sock *tsk1 = tipc_sk(sock1->sk);
u32 onode = tipc_own_addr(sock_net(sock1->sk));
tipc_sk_finish_conn(tsk1, tsk2->portid, 0);
tipc_sk_finish_conn(tsk2, tsk1->portid, 0); tsk1->peer.family = AF_TIPC;
tsk1->peer.addrtype = TIPC_ADDR_ID;
tsk1->peer.scope = TIPC_NODE_SCOPE;
tsk1->peer.addr.id.ref = tsk2->portid;
tsk1->peer.addr.id.node = onode;
tsk2->peer.family = AF_TIPC;
tsk2->peer.addrtype = TIPC_ADDR_ID;
tsk2->peer.scope = TIPC_NODE_SCOPE;
tsk2->peer.addr.id.ref = tsk1->portid;
tsk2->peer.addr.id.node = onode;
tipc_sk_finish_conn(tsk1, tsk2->portid, onode);
tipc_sk_finish_conn(tsk2, tsk1->portid, onode);
return 0; return 0;
} }
...@@ -2529,7 +2541,7 @@ static const struct proto_ops msg_ops = { ...@@ -2529,7 +2541,7 @@ static const struct proto_ops msg_ops = {
.release = tipc_release, .release = tipc_release,
.bind = tipc_bind, .bind = tipc_bind,
.connect = tipc_connect, .connect = tipc_connect,
.socketpair = sock_no_socketpair, .socketpair = tipc_socketpair,
.accept = sock_no_accept, .accept = sock_no_accept,
.getname = tipc_getname, .getname = tipc_getname,
.poll = tipc_poll, .poll = tipc_poll,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment