]>
Commit | Line | Data |
---|---|---|
8a81a37e CW |
1 | From stable-bounces@linux.kernel.org Wed Feb 28 11:31:59 2007 |
2 | Date: Wed, 28 Feb 2007 11:29:33 -0800 (PST) | |
3 | Message-Id: <20070228.112933.41634877.davem@davemloft.net> | |
4 | To: stable@kernel.org | |
5 | From: David Miller <davem@davemloft.net> | |
6 | Cc: bunk@stusta.de | |
7 | Subject: TCP: Fix minisock tcp_create_openreq_child() typo. | |
8 | ||
9 | From: Arnaldo Carvalho de Melo <acme@redhat.com> | |
10 | ||
11 | On 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 | ||
34 | Good catch! | |
35 | ||
36 | David, please apply the attached patch. | |
37 | ||
38 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
39 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
40 | Signed-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 */ |