Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70b03759 authored by Erik Hugne's avatar Erik Hugne Committed by David S. Miller
Browse files

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: 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 d6956ac8
Loading
Loading
Loading
Loading
+12 −2
Original line number Original line Diff line number Diff line
@@ -2511,6 +2511,16 @@ static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
	}
	}
}
}


static int tipc_socketpair(struct socket *sock1, struct socket *sock2)
{
	struct tipc_sock *tsk2 = tipc_sk(sock2->sk);
	struct tipc_sock *tsk1 = tipc_sk(sock1->sk);

	tipc_sk_finish_conn(tsk1, tsk2->portid, 0);
	tipc_sk_finish_conn(tsk2, tsk1->portid, 0);
	return 0;
}

/* Protocol switches for the various types of TIPC sockets */
/* Protocol switches for the various types of TIPC sockets */


static const struct proto_ops msg_ops = {
static const struct proto_ops msg_ops = {
@@ -2540,7 +2550,7 @@ static const struct proto_ops packet_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		= tipc_accept,
	.accept		= tipc_accept,
	.getname	= tipc_getname,
	.getname	= tipc_getname,
	.poll		= tipc_poll,
	.poll		= tipc_poll,
@@ -2561,7 +2571,7 @@ static const struct proto_ops stream_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		= tipc_accept,
	.accept		= tipc_accept,
	.getname	= tipc_getname,
	.getname	= tipc_getname,
	.poll		= tipc_poll,
	.poll		= tipc_poll,