diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-22 06:11:04 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:10:39 -0800 |
commit | 3b4bc4a2bfe80d01ebd4f2b6dcc58986c970ed16 (patch) | |
tree | d9dea3af7fb8fc828af0ba484c1fc06007dce351 /net/ipv4 | |
parent | e31e0bdc7e7fb9a4b09d2f3266c035a18fdcee9d (diff) | |
download | blackbird-obmc-linux-3b4bc4a2bfe80d01ebd4f2b6dcc58986c970ed16.tar.gz blackbird-obmc-linux-3b4bc4a2bfe80d01ebd4f2b6dcc58986c970ed16.zip |
[NETNS][FRAGS]: Isolate the secret interval from namespaces.
Since we have one hashtable to lookup the fragment, having
different secret_interval-s for hash rebuild doesn't make
sense, so move this one to inet_frags.
The inet_frags_ctl becomes empty after this, so remove it.
The appropriate ctl table is kept read-only in namespaces.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_fragment.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 5ab399c15282..fcf5252166fa 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -47,7 +47,7 @@ static void inet_frag_secret_rebuild(unsigned long dummy) } write_unlock(&f->lock); - mod_timer(&f->secret_timer, now + f->ctl->secret_interval); + mod_timer(&f->secret_timer, now + f->secret_interval); } void inet_frags_init(struct inet_frags *f) @@ -65,7 +65,7 @@ void inet_frags_init(struct inet_frags *f) setup_timer(&f->secret_timer, inet_frag_secret_rebuild, (unsigned long)f); - f->secret_timer.expires = jiffies + f->ctl->secret_interval; + f->secret_timer.expires = jiffies + f->secret_interval; add_timer(&f->secret_timer); } EXPORT_SYMBOL(inet_frags_init); diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 80c2c19196cd..00646ed451f5 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -74,10 +74,6 @@ struct ipq { struct inet_peer *peer; }; -static struct inet_frags_ctl ip4_frags_ctl __read_mostly = { - .secret_interval = 10 * 60 * HZ, -}; - static struct inet_frags ip4_frags; int ip_frag_nqueues(struct net *net) @@ -627,7 +623,7 @@ static struct ctl_table ip4_frags_ctl_table[] = { { .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL, .procname = "ipfrag_secret_interval", - .data = &ip4_frags_ctl.secret_interval, + .data = &ip4_frags.secret_interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, @@ -720,7 +716,6 @@ static int ipv4_frags_init_net(struct net *net) void __init ipfrag_init(void) { ipv4_frags_init_net(&init_net); - ip4_frags.ctl = &ip4_frags_ctl; ip4_frags.hashfn = ip4_hashfn; ip4_frags.constructor = ip4_frag_init; ip4_frags.destructor = ip4_frag_free; @@ -728,6 +723,7 @@ void __init ipfrag_init(void) ip4_frags.qsize = sizeof(struct ipq); ip4_frags.match = ip4_frag_match; ip4_frags.frag_expire = ip_expire; + ip4_frags.secret_interval = 10 * 60 * HZ; inet_frags_init(&ip4_frags); } |