aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@gmail.com>2017-03-29 05:22:16 -0400
committerDavid S. Miller <davem@davemloft.net>2017-03-29 17:10:11 -0400
commit70b03759e9ecfae400605fa34f3d7154cccbbba3 (patch)
tree18981c8f2aab336f83bcea172782486bc2d43a1b /net/tipc
parentd6956ac87b5ff6841b09c273a70de86200d82019 (diff)
tipc: add support for stream/seqpacket socketpairs
sockets A and B are connected back-to-back, similar to what AF_UNIX does. Signed-off-by: Erik Hugne <erik.hugne@gmail.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 7130e73bd42c..1198dddf72e8 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2511,6 +2511,16 @@ static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
2511 } 2511 }
2512} 2512}
2513 2513
2514static int tipc_socketpair(struct socket *sock1, struct socket *sock2)
2515{
2516 struct tipc_sock *tsk2 = tipc_sk(sock2->sk);
2517 struct tipc_sock *tsk1 = tipc_sk(sock1->sk);
2518
2519 tipc_sk_finish_conn(tsk1, tsk2->portid, 0);
2520 tipc_sk_finish_conn(tsk2, tsk1->portid, 0);
2521 return 0;
2522}
2523
2514/* Protocol switches for the various types of TIPC sockets */ 2524/* Protocol switches for the various types of TIPC sockets */
2515 2525
2516static const struct proto_ops msg_ops = { 2526static const struct proto_ops msg_ops = {
@@ -2540,7 +2550,7 @@ static const struct proto_ops packet_ops = {
2540 .release = tipc_release, 2550 .release = tipc_release,
2541 .bind = tipc_bind, 2551 .bind = tipc_bind,
2542 .connect = tipc_connect, 2552 .connect = tipc_connect,
2543 .socketpair = sock_no_socketpair, 2553 .socketpair = tipc_socketpair,
2544 .accept = tipc_accept, 2554 .accept = tipc_accept,
2545 .getname = tipc_getname, 2555 .getname = tipc_getname,
2546 .poll = tipc_poll, 2556 .poll = tipc_poll,
@@ -2561,7 +2571,7 @@ static const struct proto_ops stream_ops = {
2561 .release = tipc_release, 2571 .release = tipc_release,
2562 .bind = tipc_bind, 2572 .bind = tipc_bind,
2563 .connect = tipc_connect, 2573 .connect = tipc_connect,
2564 .socketpair = sock_no_socketpair, 2574 .socketpair = tipc_socketpair,
2565 .accept = tipc_accept, 2575 .accept = tipc_accept,
2566 .getname = tipc_getname, 2576 .getname = tipc_getname,
2567 .poll = tipc_poll, 2577 .poll = tipc_poll,