Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 72317 | Differences between
and this patch

Collapse All | Expand All

(-)a/net/unix/af_unix.c (-4 / +27 lines)
Lines 477-482 Link Here
477
			      struct msghdr *, size_t, int);
477
			      struct msghdr *, size_t, int);
478
static int unix_dgram_connect(struct socket *, struct sockaddr *,
478
static int unix_dgram_connect(struct socket *, struct sockaddr *,
479
			      int, int);
479
			      int, int);
480
static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,
481
				  struct msghdr *, size_t);
480
482
481
static struct proto_ops unix_stream_ops = {
483
static struct proto_ops unix_stream_ops = {
482
	.family =	PF_UNIX,
484
	.family =	PF_UNIX,
Lines 535-541 Link Here
535
	.shutdown =	unix_shutdown,
537
	.shutdown =	unix_shutdown,
536
	.setsockopt =	sock_no_setsockopt,
538
	.setsockopt =	sock_no_setsockopt,
537
	.getsockopt =	sock_no_getsockopt,
539
	.getsockopt =	sock_no_getsockopt,
538
	.sendmsg =	unix_dgram_sendmsg,
540
	.sendmsg =	unix_seqpacket_sendmsg,
539
	.recvmsg =	unix_dgram_recvmsg,
541
	.recvmsg =	unix_dgram_recvmsg,
540
	.mmap =		sock_no_mmap,
542
	.mmap =		sock_no_mmap,
541
	.sendpage =	sock_no_sendpage,
543
	.sendpage =	sock_no_sendpage,
Lines 1365-1373 Link Here
1365
	if (other->sk_shutdown & RCV_SHUTDOWN)
1367
	if (other->sk_shutdown & RCV_SHUTDOWN)
1366
		goto out_unlock;
1368
		goto out_unlock;
1367
1369
1368
	err = security_unix_may_send(sk->sk_socket, other->sk_socket);
1370
	if (sk->sk_type != SOCK_SEQPACKET) {
1369
	if (err)
1371
		err = security_unix_may_send(sk->sk_socket, other->sk_socket);
1370
		goto out_unlock;
1372
		if (err)
1373
			goto out_unlock;
1374
	}
1371
1375
1372
	if (unix_peer(other) != sk &&
1376
	if (unix_peer(other) != sk &&
1373
	    (skb_queue_len(&other->sk_receive_queue) >
1377
	    (skb_queue_len(&other->sk_receive_queue) >
Lines 1517-1522 Link Here
1517
	return sent ? : err;
1521
	return sent ? : err;
1518
}
1522
}
1519
1523
1524
static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock,
1525
				  struct msghdr *msg, size_t len)
1526
{
1527
	int err;
1528
	struct sock *sk = sock->sk;
1529
	
1530
	err = sock_error(sk);
1531
	if (err)
1532
		return err;
1533
1534
	if (sk->sk_state != TCP_ESTABLISHED)
1535
		return -ENOTCONN;
1536
1537
	if (msg->msg_namelen)
1538
		msg->msg_namelen = 0;
1539
1540
	return unix_dgram_sendmsg(kiocb, sock, msg, len);
1541
}
1542
                                                                                            
1520
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
1543
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
1521
{
1544
{
1522
	struct unix_sock *u = unix_sk(sk);
1545
	struct unix_sock *u = unix_sk(sk);

Return to bug 72317