netfilter: synproxy: correct wscale option passing

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:06 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=c1898c4c295b735c05af4c09664993fd8f257c2b
Commit:     c1898c4c295b735c05af4c09664993fd8f257c2b
Parent:     a6441b7a39f18acb68c83cd738f1310881aa8a0b
Author:     Martin Topholm <mph at one.com>
AuthorDate: Thu Nov 14 15:35:31 2013 +0100
Committer:  Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Mon Nov 18 12:53:38 2013 +0100

    netfilter: synproxy: correct wscale option passing
    
    Timestamp are used to store additional syncookie parameters such as sack,
    ecn, and wscale. The wscale value we need to encode is the client's
    wscale, since we can't recover that later in the session. Next overwrite
    the wscale option so the later synproxy_send_client_synack will send
    the backend's wscale to the client.
    
    Signed-off-by: Martin Topholm <mph at one.com>
    Reviewed-by: Jesper Dangaard Brouer <brouer at redhat.com>
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
---
 net/netfilter/nf_synproxy_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
index cdf4567..9858e3e 100644
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -151,9 +151,10 @@ void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info,
 	opts->tsecr = opts->tsval;
 	opts->tsval = tcp_time_stamp & ~0x3f;
 
-	if (opts->options & XT_SYNPROXY_OPT_WSCALE)
-		opts->tsval |= info->wscale;
-	else
+	if (opts->options & XT_SYNPROXY_OPT_WSCALE) {
+		opts->tsval |= opts->wscale;
+		opts->wscale = info->wscale;
+	} else
 		opts->tsval |= 0xf;
 
 	if (opts->options & XT_SYNPROXY_OPT_SACK_PERM)



More information about the linux-mtd-cvs mailing list