(usagi-users 03606) [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone().

YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
Newsgroups gmane.linux.ipv6.usagi.users,gmane.linux.network
Organization USAGI/WIDE Project
Message-ID <[email protected]>
Hello.

In article <[email protected]> (at Fri, 17 Feb 2006 11:38:42 +0100), Olivier MATZ <[email protected]> says:

> in skb_clone(), the following code is done twice :
> 
> #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
> 	C(nfct_reasm);
> 	nf_conntrack_get_reasm(skb->nfct_reasm);
> #endif

David, please apply the fillowing patch.

Thank you.

---
[NET]: NETFILTER: remove duplicated lines and fix order in skb_clone().

Some of netfilter-related members are initalized / copied twice in
skb_clone(). Remove one. Pointed out by Olivier MATZ <[email protected]>.

And this patch also fixes order of copying / clearing members.

Signed-off-by: YOSHIFUJI Hideaki <[email protected]>

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6766f11..2144952 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -411,6 +411,9 @@ struct sk_buff *skb_clone(struct sk_buff
 	C(pkt_type);
 	C(ip_summed);
 	C(priority);
+#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
+	C(ipvs_property);
+#endif
 	C(protocol);
 	n->destructor = NULL;
 #ifdef CONFIG_NETFILTER
@@ -422,13 +425,6 @@ struct sk_buff *skb_clone(struct sk_buff
 	C(nfct_reasm);
 	nf_conntrack_get_reasm(skb->nfct_reasm);
 #endif
-#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
-	C(ipvs_property);
-#endif
-#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
-	C(nfct_reasm);
-	nf_conntrack_get_reasm(skb->nfct_reasm);
-#endif
 #ifdef CONFIG_BRIDGE_NETFILTER
 	C(nf_bridge);
 	nf_bridge_get(skb->nf_bridge);

-- 
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.