diff options
author | Shan Wei <shanwei@cn.fujitsu.com> | 2010-01-20 04:42:41 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-01-20 04:42:41 -0500 |
commit | 7c070aa947d1a4105742378579c267f6e7fd08a1 (patch) | |
tree | 51e0b9344d224fbcfed562361559d881c5fa45de | |
parent | b38f6eddeee510ce8178c2d2db54ed25f1d7cb63 (diff) |
IPv6: reassembly: replace magic number with macro definitions
Use macro to define high/low thresh value, refer to IPV6_FRAG_TIMEOUT.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | include/net/ipv6.h | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 4 | ||||
-rw-r--r-- | 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 ccab5946c830..299bbf5adfb6 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); | |||
246 | int ip6_frag_nqueues(struct net *net); | 246 | int ip6_frag_nqueues(struct net *net); |
247 | int ip6_frag_mem(struct net *net); | 247 | int ip6_frag_mem(struct net *net); |
248 | 248 | ||
249 | #define IPV6_FRAG_HIGH_THRESH 262144 /* == 256*1024 */ | ||
250 | #define IPV6_FRAG_LOW_THRESH 196608 /* == 192*1024 */ | ||
249 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ | 251 | #define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ |
250 | 252 | ||
251 | extern int __ipv6_addr_type(const struct in6_addr *addr); | 253 | 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 1030ce1e6c79..744ea49de356 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) | |||
666 | nf_frags.frag_expire = nf_ct_frag6_expire; | 666 | nf_frags.frag_expire = nf_ct_frag6_expire; |
667 | nf_frags.secret_interval = 10 * 60 * HZ; | 667 | nf_frags.secret_interval = 10 * 60 * HZ; |
668 | nf_init_frags.timeout = IPV6_FRAG_TIMEOUT; | 668 | nf_init_frags.timeout = IPV6_FRAG_TIMEOUT; |
669 | nf_init_frags.high_thresh = 256 * 1024; | 669 | nf_init_frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
670 | nf_init_frags.low_thresh = 192 * 1024; | 670 | nf_init_frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
671 | inet_frags_init_net(&nf_init_frags); | 671 | inet_frags_init_net(&nf_init_frags); |
672 | inet_frags_init(&nf_frags); | 672 | inet_frags_init(&nf_frags); |
673 | 673 | ||
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 2cddea3bd6be..15bb122e1ce4 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -747,8 +747,8 @@ static inline void ip6_frags_sysctl_unregister(void) | |||
747 | 747 | ||
748 | static int ipv6_frags_init_net(struct net *net) | 748 | static int ipv6_frags_init_net(struct net *net) |
749 | { | 749 | { |
750 | net->ipv6.frags.high_thresh = 256 * 1024; | 750 | net->ipv6.frags.high_thresh = IPV6_FRAG_HIGH_THRESH; |
751 | net->ipv6.frags.low_thresh = 192 * 1024; | 751 | net->ipv6.frags.low_thresh = IPV6_FRAG_LOW_THRESH; |
752 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; | 752 | net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; |
753 | 753 | ||
754 | inet_frags_init_net(&net->ipv6.frags); | 754 | inet_frags_init_net(&net->ipv6.frags); |