syncookies: Make sure ECN is disabled
authorFlorian Westphal <fw@strlen.de>
Sat, 26 Jul 2008 09:21:54 +0000 (02:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Jul 2008 09:21:54 +0000 (02:21 -0700)
ecn_ok is not initialized when a connection is established by cookies.
The cookie syn-ack never sets ECN, so ecn_ok must be set to 0.

Spotted using ns-3/network simulation cradle simulator and valgrind.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/syncookies.c
net/ipv6/syncookies.c

index 51bc24d3b8a71580a097ff13df9a4781f10b0575..9d38005abbace6956bf3a5493aaacf58d7a9d90b 100644 (file)
@@ -299,6 +299,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
        ireq->rmt_port          = th->source;
        ireq->loc_addr          = ip_hdr(skb)->daddr;
        ireq->rmt_addr          = ip_hdr(skb)->saddr;
+       ireq->ecn_ok            = 0;
        ireq->snd_wscale        = tcp_opt.snd_wscale;
        ireq->rcv_wscale        = tcp_opt.rcv_wscale;
        ireq->sack_ok           = tcp_opt.sack_ok;
index 6a68eeb7bbf8ba76b5834d5960991aad4a3021da..a46badd1082d9c55a2388dd3e31d2882db68df06 100644 (file)
@@ -223,6 +223,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
 
        req->expires = 0UL;
        req->retrans = 0;
+       ireq->ecn_ok            = 0;
        ireq->snd_wscale        = tcp_opt.snd_wscale;
        ireq->rcv_wscale        = tcp_opt.rcv_wscale;
        ireq->sack_ok           = tcp_opt.sack_ok;