Skip to content

Commit

Permalink
[TIPC]: Stream socket can now send > 66000 bytes at a time
Browse files Browse the repository at this point in the history
The stream socket send code was not initializing some required fields
of the temporary msghdr structure it was utilizing; this is now fixed.
A check has also been added to detect if a user illegally specifies
a destination address when sending on an established stream connection.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Oct 19, 2006
1 parent 29ede24 commit eb5959c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* net/tipc/socket.c: TIPC socket API
*
* Copyright (c) 2001-2006, Ericsson AB
* Copyright (c) 2004-2005, Wind River Systems
* Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -629,6 +629,9 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
return -ENOTCONN;
}

if (unlikely(m->msg_name))
return -EISCONN;

/*
* Send each iovec entry using one or more messages
*
Expand All @@ -641,6 +644,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
curr_iovlen = m->msg_iovlen;
my_msg.msg_iov = &my_iov;
my_msg.msg_iovlen = 1;
my_msg.msg_flags = m->msg_flags;
my_msg.msg_name = NULL;
bytes_sent = 0;

while (curr_iovlen--) {
Expand Down

0 comments on commit eb5959c

Please sign in to comment.