]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tcp: initialize variable ecn_ok in syncookies path
authorMike Waychison <mikew@google.com>
Thu, 11 Aug 2011 04:59:57 +0000 (21:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Aug 2011 04:59:57 +0000 (21:59 -0700)
Using a gcc 4.4.3, warnings are emitted for a possibly uninitialized use
of ecn_ok.

This can happen if cookie_check_timestamp() returns due to not having
seen a timestamp.  Defaulting to ecn off seems like a reasonable thing
to do in this case, so initialized ecn_ok to false.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/syncookies.c
net/ipv6/syncookies.c

index 92bb9434b338d0064becad817e2aaf96f402870d..3bc5c8f7c71bba52e2a005d95566e52327ef7fa6 100644 (file)
@@ -276,7 +276,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
        int mss;
        struct rtable *rt;
        __u8 rcv_wscale;
-       bool ecn_ok;
+       bool ecn_ok = false;
 
        if (!sysctl_tcp_syncookies || !th->ack || th->rst)
                goto out;
index 89d5bf8062223338cc1cbc548d53171b957734dc..ac838965ff34551693a44f758b5a2e8bcef79c74 100644 (file)
@@ -165,7 +165,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
        int mss;
        struct dst_entry *dst;
        __u8 rcv_wscale;
-       bool ecn_ok;
+       bool ecn_ok = false;
 
        if (!sysctl_tcp_syncookies || !th->ack || th->rst)
                goto out;