* [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions
@ 2010-01-20 6:21 Shan Wei
2010-01-20 9:32 ` David Miller
2010-01-20 9:43 ` Patrick McHardy
0 siblings, 2 replies; 4+ messages in thread
From: Shan Wei @ 2010-01-20 6:21 UTC (permalink / raw)
To: David Miller, kuznet, pekkas, yoshfuji, Patrick McHardy,
eric.dumazet, adobriyan
Cc: netdev@vger.kernel.org, netfilter-devel, coreteam
Use macro to define high/low thresh value, refer to IPV6_FRAG_TIMEOUT.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
include/net/ipv6.h | 2 ++
net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++--
net/ipv6/reassembly.c | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index ccab594..299bbf5 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -246,6 +246,8 @@ extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb);
int ip6_frag_nqueues(struct net *net);
int ip6_frag_mem(struct net *net);
+#define IPV6_FRAG_HIGH_THRESH 262144 /* == 256*1024 */
+#define IPV6_FRAG_LOW_THRESH 196608 /* == 192*1024 */
#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */
extern int __ipv6_addr_type(const struct in6_addr *addr);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 1030ce1..744ea49 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -666,8 +666,8 @@ int nf_ct_frag6_init(void)
nf_frags.frag_expire = nf_ct_frag6_expire;
nf_frags.secret_interval = 10 * 60 * HZ;
nf_init_frags.timeout = IPV6_FRAG_TIMEOUT;
- nf_init_frags.high_thresh = 256 * 1024;
- nf_init_frags.low_thresh = 192 * 1024;
+ nf_init_frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
+ nf_init_frags.low_thresh = IPV6_FRAG_LOW_THRESH;
inet_frags_init_net(&nf_init_frags);
inet_frags_init(&nf_frags);
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2cddea3..15bb122 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -747,8 +747,8 @@ static inline void ip6_frags_sysctl_unregister(void)
static int ipv6_frags_init_net(struct net *net)
{
- net->ipv6.frags.high_thresh = 256 * 1024;
- net->ipv6.frags.low_thresh = 192 * 1024;
+ net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH;
+ net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH;
net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT;
inet_frags_init_net(&net->ipv6.frags);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions
2010-01-20 6:21 [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions Shan Wei
@ 2010-01-20 9:32 ` David Miller
2010-01-20 9:37 ` Patrick McHardy
2010-01-20 9:43 ` Patrick McHardy
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2010-01-20 9:32 UTC (permalink / raw)
To: shanwei
Cc: kuznet, pekkas, yoshfuji, kaber, eric.dumazet, adobriyan, netdev,
netfilter-devel, coreteam
From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Wed, 20 Jan 2010 14:21:17 +0800
>
> Use macro to define high/low thresh value, refer to IPV6_FRAG_TIMEOUT.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Patrick you can take this into your tree:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions
2010-01-20 9:32 ` David Miller
@ 2010-01-20 9:37 ` Patrick McHardy
0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2010-01-20 9:37 UTC (permalink / raw)
To: David Miller
Cc: shanwei, kuznet, pekkas, yoshfuji, eric.dumazet, adobriyan,
netdev, netfilter-devel, coreteam
David Miller wrote:
> From: Shan Wei <shanwei@cn.fujitsu.com>
> Date: Wed, 20 Jan 2010 14:21:17 +0800
>
>> Use macro to define high/low thresh value, refer to IPV6_FRAG_TIMEOUT.
>>
>>
>> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
>
> Patrick you can take this into your tree:
>
> Acked-by: David S. Miller <davem@davemloft.net>
Will do, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions
2010-01-20 6:21 [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions Shan Wei
2010-01-20 9:32 ` David Miller
@ 2010-01-20 9:43 ` Patrick McHardy
1 sibling, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2010-01-20 9:43 UTC (permalink / raw)
To: Shan Wei
Cc: David Miller, kuznet, pekkas, yoshfuji, eric.dumazet, adobriyan,
netdev@vger.kernel.org, netfilter-devel, coreteam
Shan Wei wrote:
> Use macro to define high/low thresh value, refer to IPV6_FRAG_TIMEOUT.
Also applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-20 9:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 6:21 [PATCH 2/2] IPv6: reassembly: replace magic number with macro definitions Shan Wei
2010-01-20 9:32 ` David Miller
2010-01-20 9:37 ` Patrick McHardy
2010-01-20 9:43 ` Patrick McHardy
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).