All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH NF_CONNTRACK 8/9]: zero-clear union area in tuple for expectant
@ 2005-05-23  6:23 Yasuyuki KOZAKAI
  2005-06-11 15:36 ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Yasuyuki KOZAKAI @ 2005-05-23  6:23 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel

[-- Attachment #1: Type: Text/Plain, Size: 253 bytes --]

This patch clears union area in tuple for expectant.

Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>

-----------------------------------------------------------------
Yasuyuki Kozakai @ USAGI Project <yasuyuki.kozakai@toshiba.co.jp>


[-- Attachment #2: 08-expect.patch --]
[-- Type: Text/Plain, Size: 556 bytes --]

diff -Nur linux-2.6.12-rc4-nfct-7-nat-seq/net/netfilter/nf_conntrack_core.c linux-2.6.12-rc4-nfct-8-expect/net/netfilter/nf_conntrack_core.c
--- linux-2.6.12-rc4-nfct-7-nat-seq/net/netfilter/nf_conntrack_core.c	2005-05-20 03:18:29.000000000 +0900
+++ linux-2.6.12-rc4-nfct-8-expect/net/netfilter/nf_conntrack_core.c	2005-05-20 03:16:23.000000000 +0900
@@ -987,6 +987,8 @@
 		DEBUGP("expect_related: OOM allocating expect\n");
 		return NULL;
 	}
+	NF_CT_TUPLE_U_BLANK(&new->tuple);
+	NF_CT_TUPLE_U_BLANK(&new->mask);
 	new->master = NULL;
 	return new;
 }

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

* Re: [PATCH NF_CONNTRACK 8/9]: zero-clear union area in tuple for expectant
  2005-05-23  6:23 [PATCH NF_CONNTRACK 8/9]: zero-clear union area in tuple for expectant Yasuyuki KOZAKAI
@ 2005-06-11 15:36 ` Patrick McHardy
  2005-06-15  4:05   ` Yasuyuki KOZAKAI
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2005-06-11 15:36 UTC (permalink / raw)
  To: Yasuyuki KOZAKAI; +Cc: netfilter-devel

Yasuyuki KOZAKAI wrote:
> This patch clears union area in tuple for expectant.

Why is this necessary? The helpers should initialize tuple and mask.

Regards
Patrick

> diff -Nur linux-2.6.12-rc4-nfct-7-nat-seq/net/netfilter/nf_conntrack_core.c linux-2.6.12-rc4-nfct-8-expect/net/netfilter/nf_conntrack_core.c
> --- linux-2.6.12-rc4-nfct-7-nat-seq/net/netfilter/nf_conntrack_core.c	2005-05-20 03:18:29.000000000 +0900
> +++ linux-2.6.12-rc4-nfct-8-expect/net/netfilter/nf_conntrack_core.c	2005-05-20 03:16:23.000000000 +0900
> @@ -987,6 +987,8 @@
>  		DEBUGP("expect_related: OOM allocating expect\n");
>  		return NULL;
>  	}
> +	NF_CT_TUPLE_U_BLANK(&new->tuple);
> +	NF_CT_TUPLE_U_BLANK(&new->mask);
>  	new->master = NULL;
>  	return new;
>  }

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

* Re: [PATCH NF_CONNTRACK 8/9]: zero-clear union area in tuple for expectant
  2005-06-11 15:36 ` Patrick McHardy
@ 2005-06-15  4:05   ` Yasuyuki KOZAKAI
  0 siblings, 0 replies; 3+ messages in thread
From: Yasuyuki KOZAKAI @ 2005-06-15  4:05 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel, yasuyuki.kozakai

[-- Attachment #1: Type: Text/Plain, Size: 425 bytes --]


From: Patrick McHardy <kaber@trash.net>
Date: Sat, 11 Jun 2005 17:36:44 +0200

> Yasuyuki KOZAKAI wrote:
> > This patch clears union area in tuple for expectant.
> 
> Why is this necessary? The helpers should initialize tuple and mask.

OK, please apply this patch instead of it.

Regards,

-----------------------------------------------------------------
Yasuyuki Kozakai @ USAGI Project <yasuyuki.kozakai@toshiba.co.jp>


[-- Attachment #2: exp-tuple-init.patch --]
[-- Type: Text/Plain, Size: 1564 bytes --]

Index: net/netfilter/nf_conntrack_ftp.c
===================================================================
--- 9f4386a4dd0fa00c434d7acc6b8bc3de43e60a3b/net/netfilter/nf_conntrack_ftp.c  (mode:100644)
+++ uncommitted/net/netfilter/nf_conntrack_ftp.c  (mode:100644)
@@ -565,28 +565,29 @@
 		       sizeof(exp->tuple.dst.u3));
 	}
 
+	exp->tuple.src.u3 = ct->tuplehash[!dir].tuple.src.u3;
+	exp->tuple.src.l3num = cmd.l3num;
+	exp->tuple.src.u.tcp.port = 0;
+	exp->tuple.dst.u.tcp.port = cmd.u.tcp.port;
+	exp->tuple.dst.protonum = IPPROTO_TCP;
+
+	exp->mask = (struct nf_conntrack_tuple)
+		    { .src = { .l3num = 0xFFFF,
+			       .u = { .tcp = { 0 }},
+			     },
+		      .dst = { .protonum = 0xFF,
+			       .u = { .tcp = { 0xFFFF }},
+			     },
+		    };
 	if (cmd.l3num == PF_INET) {
-		exp->tuple.src.u3.ip = ct->tuplehash[!dir].tuple.src.u3.ip;
 		exp->mask.src.u3.ip = 0xFFFFFFFF;
 		exp->mask.dst.u3.ip = 0xFFFFFFFF;
 	} else {
-		memcpy(exp->tuple.src.u3.ip6,
-		       ct->tuplehash[!dir].tuple.src.u3.ip6,
-		       sizeof(exp->tuple.src.u3.ip6));
 		memset(exp->mask.src.u3.ip6, 0xFF,
 		       sizeof(exp->mask.src.u3.ip6));
 		memset(exp->mask.dst.u3.ip6, 0xFF,
 		       sizeof(exp->mask.src.u3.ip6));
 	}
-	exp->tuple.src.l3num = cmd.l3num;
-	exp->tuple.src.u.tcp.port = 0;
-	exp->tuple.dst.u.tcp.port = cmd.u.tcp.port;
-	exp->tuple.dst.protonum = IPPROTO_TCP;
-
-	exp->mask.src.l3num = 0xFFFF;
-	exp->mask.src.u.tcp.port = 0;
-	exp->mask.dst.u.tcp.port = 0xFFFF;
-	exp->mask.dst.protonum = 0xFF;
 
 	exp->expectfn = NULL;
 	exp->master = ct;

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

end of thread, other threads:[~2005-06-15  4:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-23  6:23 [PATCH NF_CONNTRACK 8/9]: zero-clear union area in tuple for expectant Yasuyuki KOZAKAI
2005-06-11 15:36 ` Patrick McHardy
2005-06-15  4:05   ` Yasuyuki KOZAKAI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.