From mboxrd@z Thu Jan 1 00:00:00 1970 From: Per Liden Subject: [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Date: Fri, 13 Oct 2006 13:37:44 +0200 Message-ID: <11607394753960-git-send-email-per.liden@ericsson.com> References: Reply-To: Per Liden Cc: netdev@vger.kernel.org, Allan Stephens Return-path: Received: from mailgw4.ericsson.se ([193.180.251.62]:47008 "EHLO mailgw4.ericsson.se") by vger.kernel.org with ESMTP id S1751391AbWJMLiC (ORCPT ); Fri, 13 Oct 2006 07:38:02 -0400 To: David Miller In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Allan Stephens 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 Signed-off-by: Per Liden --- net/tipc/socket.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index acfb852..ed900fe 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -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 @@ -629,6 +629,9 @@ static int send_stream(struct kiocb *ioc return -ENOTCONN; } + if (unlikely(m->msg_name)) + return -EISCONN; + /* * Send each iovec entry using one or more messages * @@ -641,6 +644,8 @@ static int send_stream(struct kiocb *ioc 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--) { -- 1.4.1