aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-08-02 22:23:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-08-02 22:42:28 -0400
commit3516ffb0fef710749daf288c0fe146503e0cf9d4 (patch)
treef3e3cd29dd541a457e61152560fe4416642a69bc /net/ipv6
parent1bcabbdb0bdfe8b15b05150a7857646430aaa7f8 (diff)
[TCP]: Invoke tcp_sendmsg() directly, do not use inet_sendmsg().
As discovered by Evegniy Polyakov, if we try to sendmsg after a connection reset, we can do incredibly stupid things. The core issue is that inet_sendmsg() tries to autobind the socket, but we should never do that for TCP. Instead we should just go straight into TCP's sendmsg() code which will do all of the necessary state and pending socket error checks. TCP's sendpage already directly vectors to tcp_sendpage(), so this merely brings sendmsg() in line with that. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/tcp_ipv6.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index eed09373a45d..b5f96372ad73 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -484,7 +484,7 @@ const struct proto_ops inet6_stream_ops = {
484 .shutdown = inet_shutdown, /* ok */ 484 .shutdown = inet_shutdown, /* ok */
485 .setsockopt = sock_common_setsockopt, /* ok */ 485 .setsockopt = sock_common_setsockopt, /* ok */
486 .getsockopt = sock_common_getsockopt, /* ok */ 486 .getsockopt = sock_common_getsockopt, /* ok */
487 .sendmsg = inet_sendmsg, /* ok */ 487 .sendmsg = tcp_sendmsg, /* ok */
488 .recvmsg = sock_common_recvmsg, /* ok */ 488 .recvmsg = sock_common_recvmsg, /* ok */
489 .mmap = sock_no_mmap, 489 .mmap = sock_no_mmap,
490 .sendpage = tcp_sendpage, 490 .sendpage = tcp_sendpage,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f10f3689d671..cbdb78487915 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2115,7 +2115,6 @@ struct proto tcpv6_prot = {
2115 .shutdown = tcp_shutdown, 2115 .shutdown = tcp_shutdown,
2116 .setsockopt = tcp_setsockopt, 2116 .setsockopt = tcp_setsockopt,
2117 .getsockopt = tcp_getsockopt, 2117 .getsockopt = tcp_getsockopt,
2118 .sendmsg = tcp_sendmsg,
2119 .recvmsg = tcp_recvmsg, 2118 .recvmsg = tcp_recvmsg,
2120 .backlog_rcv = tcp_v6_do_rcv, 2119 .backlog_rcv = tcp_v6_do_rcv,
2121 .hash = tcp_v6_hash, 2120 .hash = tcp_v6_hash,