* (usagi-users 03606) [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone(). [not found] <43F5A7B2.90803@6wind.com> @ 2006-02-17 12:51 ` YOSHIFUJI Hideaki / 吉藤英明 2006-02-19 13:47 ` (usagi-users 03609) IPv6 setsockopt software MTU patch hoerdt 2006-02-20 6:32 ` (usagi-users 03613) Re: [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() David S. Miller 0 siblings, 2 replies; 6+ messages in thread From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-02-17 12:51 UTC (permalink / raw) To: davem; +Cc: netdev, usagi-users, olivier.matz, yoshfuji Hello. In article <43F5A7B2.90803@6wind.com> (at Fri, 17 Feb 2006 11:38:42 +0100), Olivier MATZ <olivier.matz@6wind.com> 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 <olivier.matz@6wind.com>. And this patch also fixes order of copying / clearing members. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> 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 <yoshfuji@linux-ipv6.org> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA ^ permalink raw reply related [flat|nested] 6+ messages in thread
* (usagi-users 03609) IPv6 setsockopt software MTU patch 2006-02-17 12:51 ` (usagi-users 03606) [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() YOSHIFUJI Hideaki / 吉藤英明 @ 2006-02-19 13:47 ` hoerdt 2006-02-19 14:13 ` (usagi-users 03610) " YOSHIFUJI Hideaki / 吉藤英明 2006-02-20 6:32 ` (usagi-users 03613) Re: [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() David S. Miller 1 sibling, 1 reply; 6+ messages in thread From: hoerdt @ 2006-02-19 13:47 UTC (permalink / raw) To: usagi-users; +Cc: davem, netdev, olivier.matz, yoshfuji Hi, In my precedent mails, i pointed out that IPV6_MTU setsockopt was ineffective because the field frag_size was not used further in the ipv6 fragment code of the kernel. You can check out that this is the case by this simple proof of concept code : http://clarinet.u-strasbg.fr/~hoerdt/mtu.c The fix is very simple, it only grab the value of frag_size and use it in ip6_fragment file, could you please review the patch which fix that problem at : http://clarinet.u-strasbg.fr/~hoerdt/ip6_output.c.softfrag.patch Thanks for the attention, Hoerdt Mickaël ^ permalink raw reply [flat|nested] 6+ messages in thread
* (usagi-users 03610) Re: IPv6 setsockopt software MTU patch 2006-02-19 13:47 ` (usagi-users 03609) IPv6 setsockopt software MTU patch hoerdt @ 2006-02-19 14:13 ` YOSHIFUJI Hideaki / 吉藤英明 2006-02-19 14:54 ` (usagi-users 03611) " hoerdt 0 siblings, 1 reply; 6+ messages in thread From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-02-19 14:13 UTC (permalink / raw) To: hoerdt; +Cc: usagi-users, davem, netdev, olivier.matz, yoshfuji In article <20060219134709.GC16304@clarinet.u-strasbg.fr> (at Sun, 19 Feb 2006 14:47:09 +0100), hoerdt@clarinet.u-strasbg.fr says: > The fix is very simple, it only grab the value of frag_size and > use it in ip6_fragment file, could you please review the patch which > fix that problem at : > > http://clarinet.u-strasbg.fr/~hoerdt/ip6_output.c.softfrag.patch Thanks for the patch. I think even we have np->frag_size, we should consider dst_mtu(&rt->u.dst) as well. No? --yoshfuji ^ permalink raw reply [flat|nested] 6+ messages in thread
* (usagi-users 03611) Re: IPv6 setsockopt software MTU patch 2006-02-19 14:13 ` (usagi-users 03610) " YOSHIFUJI Hideaki / 吉藤英明 @ 2006-02-19 14:54 ` hoerdt 2006-02-19 16:08 ` (usagi-users 03612) " YOSHIFUJI Hideaki / 吉藤英明 0 siblings, 1 reply; 6+ messages in thread From: hoerdt @ 2006-02-19 14:54 UTC (permalink / raw) To: usagi-users; +Cc: davem, netdev, olivier.matz, yoshfuji Yes, Hugo Santos suggested me to use the minimum of both, the new patch is available there : http://clarinet.u-strasbg.fr/~hoerdt/ip6_output.c.softfrag.patch2 Thanks, Hoerdt Mickaël On Sun, Feb 19, 2006 at 11:13:44PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20060219134709.GC16304@clarinet.u-strasbg.fr> (at Sun, 19 Feb 2006 14:47:09 +0100), hoerdt@clarinet.u-strasbg.fr says: > > > The fix is very simple, it only grab the value of frag_size and > > use it in ip6_fragment file, could you please review the patch which > > fix that problem at : > > > > http://clarinet.u-strasbg.fr/~hoerdt/ip6_output.c.softfrag.patch > > Thanks for the patch. > I think even we have np->frag_size, we should consider dst_mtu(&rt->u.dst) > as well. No? > > --yoshfuji > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* (usagi-users 03612) Re: IPv6 setsockopt software MTU patch 2006-02-19 14:54 ` (usagi-users 03611) " hoerdt @ 2006-02-19 16:08 ` YOSHIFUJI Hideaki / 吉藤英明 0 siblings, 0 replies; 6+ messages in thread From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-02-19 16:08 UTC (permalink / raw) To: hoerdt; +Cc: usagi-users, netdev, olivier.matz, davem, yoshfuji In article <20060219145413.GD16304@clarinet.u-strasbg.fr> (at Sun, 19 Feb 2006 15:54:13 +0100), hoerdt@clarinet.u-strasbg.fr says: > Yes, Hugo Santos suggested me to use the minimum of both, the new > patch is available there : > > http://clarinet.u-strasbg.fr/~hoerdt/ip6_output.c.softfrag.patch2 Do you mean like this? Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index efa3e72..3264740 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -494,6 +494,7 @@ static int ip6_fragment(struct sk_buff * struct net_device *dev; struct sk_buff *frag; struct rt6_info *rt = (struct rt6_info*)skb->dst; + struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; struct ipv6hdr *tmp_hdr; struct frag_hdr *fh; unsigned int mtu, hlen, left, len; @@ -506,6 +507,8 @@ static int ip6_fragment(struct sk_buff * nexthdr = *prevhdr; mtu = dst_mtu(&rt->u.dst) - hlen - sizeof(struct frag_hdr); + if (np && np->frag_size && np->frag_size < dst_mtu(&rt->u.dst)) + mtu = np->frag_size - hlen - sizeof(struct frag_hdr); if (skb_shinfo(skb)->frag_list) { int first_len = skb_pagelen(skb); -- YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA ^ permalink raw reply related [flat|nested] 6+ messages in thread
* (usagi-users 03613) Re: [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone(). 2006-02-17 12:51 ` (usagi-users 03606) [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() YOSHIFUJI Hideaki / 吉藤英明 2006-02-19 13:47 ` (usagi-users 03609) IPv6 setsockopt software MTU patch hoerdt @ 2006-02-20 6:32 ` David S. Miller 1 sibling, 0 replies; 6+ messages in thread From: David S. Miller @ 2006-02-20 6:32 UTC (permalink / raw) To: yoshfuji; +Cc: netdev, usagi-users, olivier.matz From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Date: Fri, 17 Feb 2006 21:51:01 +0900 (JST) > [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 <olivier.matz@6wind.com>. > > And this patch also fixes order of copying / clearing members. > > Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Patch applied to net-2.6, thank you very much. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-20 6:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <43F5A7B2.90803@6wind.com>
2006-02-17 12:51 ` (usagi-users 03606) [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() YOSHIFUJI Hideaki / 吉藤英明
2006-02-19 13:47 ` (usagi-users 03609) IPv6 setsockopt software MTU patch hoerdt
2006-02-19 14:13 ` (usagi-users 03610) " YOSHIFUJI Hideaki / 吉藤英明
2006-02-19 14:54 ` (usagi-users 03611) " hoerdt
2006-02-19 16:08 ` (usagi-users 03612) " YOSHIFUJI Hideaki / 吉藤英明
2006-02-20 6:32 ` (usagi-users 03613) Re: [PATCH] [NET]: NETFILTER: remove duplicated operation and fix order in skb_clone() David S. 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).