netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp: initialize variable ecn_ok in syncookies path
@ 2011-08-10 18:51 Mike Waychison
  2011-08-11  5:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Waychison @ 2011-08-10 18:51 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy <kabe
  Cc: netdev, linux-kernel, Mike Waychison

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>
---
 net/ipv4/syncookies.c |    2 +-
 net/ipv6/syncookies.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 92bb943..3bc5c8f 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -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;
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 89d5bf8..ac83896 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -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;
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tcp: initialize variable ecn_ok in syncookies path
  2011-08-10 18:51 [PATCH] tcp: initialize variable ecn_ok in syncookies path Mike Waychison
@ 2011-08-11  5:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-08-11  5:00 UTC (permalink / raw)
  To: mikew; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel

From: Mike Waychison <mikew@google.com>
Date: Wed, 10 Aug 2011 11:51:24 -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>

Applied, thanks Mike.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-11  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-10 18:51 [PATCH] tcp: initialize variable ecn_ok in syncookies path Mike Waychison
2011-08-11  5:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).