]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.20.2/tcp-fix-minisock-tcp_create_openreq_child-typo.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / tcp-fix-minisock-tcp_create_openreq_child-typo.patch
CommitLineData
8a81a37e
CW
1From stable-bounces@linux.kernel.org Wed Feb 28 11:31:59 2007
2Date: Wed, 28 Feb 2007 11:29:33 -0800 (PST)
3Message-Id: <20070228.112933.41634877.davem@davemloft.net>
4To: stable@kernel.org
5From: David Miller <davem@davemloft.net>
6Cc: bunk@stusta.de
7Subject: TCP: Fix minisock tcp_create_openreq_child() typo.
8
9From: Arnaldo Carvalho de Melo <acme@redhat.com>
10
11On 2/28/07, KOVACS Krisztian <hidden@balabit.hu> wrote:
12>
13> Hi,
14>
15> While reading TCP minisock code I've found this suspiciously looking
16> code fragment:
17>
18> - 8< -
19> struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, struct sk_buff *skb)
20> {
21> struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);
22>
23> if (newsk != NULL) {
24> const struct inet_request_sock *ireq = inet_rsk(req);
25> struct tcp_request_sock *treq = tcp_rsk(req);
26> struct inet_connection_sock *newicsk = inet_csk(sk);
27> struct tcp_sock *newtp;
28> - 8< -
29>
30> The above code initializes newicsk to inet_csk(sk), isn't that supposed
31> to be inet_csk(newsk)? As far as I can tell this might leave
32> icsk_ack.last_seg_size zero even if we do have received data.
33
34Good catch!
35
36David, please apply the attached patch.
37
38Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
39Signed-off-by: David S. Miller <davem@davemloft.net>
40Signed-off-by: Chris Wright <chrisw@sous-sol.org>
41
42---
43 net/ipv4/tcp_minisocks.c | 2 +-
44 1 file changed, 1 insertion(+), 1 deletion(-)
45
46--- linux-2.6.20.1.orig/net/ipv4/tcp_minisocks.c
47+++ linux-2.6.20.1/net/ipv4/tcp_minisocks.c
48@@ -381,7 +381,7 @@ struct sock *tcp_create_openreq_child(st
49 if (newsk != NULL) {
50 const struct inet_request_sock *ireq = inet_rsk(req);
51 struct tcp_request_sock *treq = tcp_rsk(req);
52- struct inet_connection_sock *newicsk = inet_csk(sk);
53+ struct inet_connection_sock *newicsk = inet_csk(newsk);
54 struct tcp_sock *newtp;
55
56 /* Now setup tcp_sock */