Skip to content

Commit

Permalink
tcp: initialize variable ecn_ok in syncookies path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Waychison authored and David S. Miller committed Aug 11, 2011
1 parent 56c0727 commit f0e3d06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f0e3d06

Please sign in to comment.