diff mbox

[GIT] Networking

Message ID 1316378130.31335.32.camel@edumazet-laptop
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Sept. 18, 2011, 8:35 p.m. UTC
Le dimanche 18 septembre 2011 à 12:55 -0700, Linus Torvalds a écrit :
> On Sun, Sep 18, 2011 at 12:48 PM, Markus Trippelsdorf
> <markus@trippelsdorf.de> wrote:
> >
> > The following works for me:
> 
> No it doesn't. It may *compile* for you, but it doesn't work for you.
> It avoids all the other stuff that tcp_syn_flood_action() also does
> (notably the printout).
> 
> The real fix looks to be either:
> 
>  - make an empty (inline/macro) cookie_v4_init_sequence() for the
> non-syncookie config case
> 

Yes, this one seems the less ugly.

Frankly, we should remove CONFIG_SYN_COOKIE option...

Sorry for the mess, dont blame David on this, since netdev guys
probably always use CONFIG_SYN_COOKIE.

Thanks

[PATCH] tcp: fix build error if !CONFIG_SYN_COOKIE

commit 946cedccbd7387 (tcp: Change possible SYN flooding messages)
added a build error if CONFIG_SYN_COOKIE=n

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 include/net/tcp.h |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Sept. 19, 2011, 1:03 a.m. UTC | #1
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 18 Sep 2011 22:35:30 +0200

> [PATCH] tcp: fix build error if !CONFIG_SYN_COOKIE
> 
> commit 946cedccbd7387 (tcp: Change possible SYN flooding messages)
> added a build error if CONFIG_SYN_COOKIE=n
> 
> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Torvalds Sept. 19, 2011, 1:26 a.m. UTC | #2
On Sun, Sep 18, 2011 at 1:35 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> [PATCH] tcp: fix build error if !CONFIG_SYN_COOKIE
>
> commit 946cedccbd7387 (tcp: Change possible SYN flooding messages)
> added a build error if CONFIG_SYN_COOKIE=n

Christ Eric, you clearly didn't even compile-test this one either.

Which is pretty bad, considering that the whole and only *point* of
the patch is to make it compile.

The config option is CONFIG_SYN_COOKIES (with an 'S' at the end), but
your patch has 'CONFIG_SYN_COOKIE' (without the S).

Which means that now it doesn't compile when syncookies are *enabled*.

I really wanted to release -rc7 today. But no way am I applying these
kinds of totally untested patches. Can you guys please get your act
together?

PLEASE?

Stop with the "this might just work" crap. Because -rc7 is just too
late to dick around like that.

                       Linus
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 19, 2011, 1:45 a.m. UTC | #3
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun, 18 Sep 2011 18:26:33 -0700

> Stop with the "this might just work" crap. Because -rc7 is just too
> late to dick around like that.

I'll sort this out.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Dumazet Sept. 19, 2011, 3:17 a.m. UTC | #4
Le dimanche 18 septembre 2011 à 21:45 -0400, David Miller a écrit :
> From: Linus Torvalds <torvalds@linux-foundation.org>
> Date: Sun, 18 Sep 2011 18:26:33 -0700
> 
> > Stop with the "this might just work" crap. Because -rc7 is just too
> > late to dick around like that.
> 
> I'll sort this out.

Oh well, I did compile the thing on my slow netbook, not on my usual 16
core dev machine, and I had to catch a very small window of Internet
access (my ADSL box collapsed when a thunderstrike hit the church in my
neighbourhood)

Thanks guys.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/tcp.h b/include/net/tcp.h
index e9b48b0..f860d64 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -431,17 +431,34 @@  extern int tcp_disconnect(struct sock *sk, int flags);
 extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
 extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 
 				    struct ip_options *opt);
+#ifdef CONFIG_SYN_COOKIE
 extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 
 				     __u16 *mss);
+#else
+static inline __u32 cookie_v4_init_sequence(struct sock *sk,
+					    struct sk_buff *skb,
+					    __u16 *mss)
+{
+	return 0;
+}
+#endif
 
 extern __u32 cookie_init_timestamp(struct request_sock *req);
 extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
 
 /* From net/ipv6/syncookies.c */
 extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
+#ifdef CONFIG_SYN_COOKIE
 extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
 				     __u16 *mss);
-
+#else
+static inline __u32 cookie_v6_init_sequence(struct sock *sk,
+					    struct sk_buff *skb,
+					    __u16 *mss)
+{
+	return 0;
+}
+#endif
 /* tcp_output.c */
 
 extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,