diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-14 13:37:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-14 13:37:28 -0400 |
commit | d7e9660ad9d5e0845f52848bce31bcf5cdcdea6b (patch) | |
tree | c6c67d145771187b194d79d603742b31090a59d6 /net/ipv6/xfrm6_policy.c | |
parent | b8cb48aae1b8c50b37dcb7710363aa69a7a0d9ca (diff) | |
parent | 13af7a6ea502fcdd4c0e3d7de6e332b102309491 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1623 commits)
netxen: update copyright
netxen: fix tx timeout recovery
netxen: fix file firmware leak
netxen: improve pci memory access
netxen: change firmware write size
tg3: Fix return ring size breakage
netxen: build fix for INET=n
cdc-phonet: autoconfigure Phonet address
Phonet: back-end for autoconfigured addresses
Phonet: fix netlink address dump error handling
ipv6: Add IFA_F_DADFAILED flag
net: Add DEVTYPE support for Ethernet based devices
mv643xx_eth.c: remove unused txq_set_wrr()
ucc_geth: Fix hangs after switching from full to half duplex
ucc_geth: Rearrange some code to avoid forward declarations
phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs
drivers/net/phy: introduce missing kfree
drivers/net/wan: introduce missing kfree
net: force bridge module(s) to be GPL
Subject: [PATCH] appletalk: Fix skb leak when ipddp interface is not loaded
...
Fixed up trivial conflicts:
- arch/x86/include/asm/socket.h
converted to <asm-generic/socket.h> in the x86 tree. The generic
header has the same new #define's, so that works out fine.
- drivers/net/tun.c
fix conflict between 89f56d1e9 ("tun: reuse struct sock fields") that
switched over to using 'tun->socket.sk' instead of the redundantly
available (and thus removed) 'tun->sk', and 2b980dbd ("lsm: Add hooks
to the TUN driver") which added a new 'tun->sk' use.
Noted in 'next' by Stephen Rothwell.
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 3a3c677bc0f2..8ec3d45cd1d9 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -306,9 +306,26 @@ static void xfrm6_policy_fini(void) | |||
306 | xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); | 306 | xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); |
307 | } | 307 | } |
308 | 308 | ||
309 | #ifdef CONFIG_SYSCTL | ||
310 | static struct ctl_table xfrm6_policy_table[] = { | ||
311 | { | ||
312 | .ctl_name = CTL_UNNUMBERED, | ||
313 | .procname = "xfrm6_gc_thresh", | ||
314 | .data = &xfrm6_dst_ops.gc_thresh, | ||
315 | .maxlen = sizeof(int), | ||
316 | .mode = 0644, | ||
317 | .proc_handler = proc_dointvec, | ||
318 | }, | ||
319 | { } | ||
320 | }; | ||
321 | |||
322 | static struct ctl_table_header *sysctl_hdr; | ||
323 | #endif | ||
324 | |||
309 | int __init xfrm6_init(void) | 325 | int __init xfrm6_init(void) |
310 | { | 326 | { |
311 | int ret; | 327 | int ret; |
328 | unsigned int gc_thresh; | ||
312 | 329 | ||
313 | ret = xfrm6_policy_init(); | 330 | ret = xfrm6_policy_init(); |
314 | if (ret) | 331 | if (ret) |
@@ -317,6 +334,23 @@ int __init xfrm6_init(void) | |||
317 | ret = xfrm6_state_init(); | 334 | ret = xfrm6_state_init(); |
318 | if (ret) | 335 | if (ret) |
319 | goto out_policy; | 336 | goto out_policy; |
337 | /* | ||
338 | * We need a good default value for the xfrm6 gc threshold. | ||
339 | * In ipv4 we set it to the route hash table size * 8, which | ||
340 | * is half the size of the maximaum route cache for ipv4. It | ||
341 | * would be good to do the same thing for v6, except the table is | ||
342 | * constructed differently here. Here each table for a net namespace | ||
343 | * can have FIB_TABLE_HASHSZ entries, so lets go with the same | ||
344 | * computation that we used for ipv4 here. Also, lets keep the initial | ||
345 | * gc_thresh to a minimum of 1024, since, the ipv6 route cache defaults | ||
346 | * to that as a minimum as well | ||
347 | */ | ||
348 | gc_thresh = FIB6_TABLE_HASHSZ * 8; | ||
349 | xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; | ||
350 | #ifdef CONFIG_SYSCTL | ||
351 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, | ||
352 | xfrm6_policy_table); | ||
353 | #endif | ||
320 | out: | 354 | out: |
321 | return ret; | 355 | return ret; |
322 | out_policy: | 356 | out_policy: |
@@ -326,6 +360,10 @@ out_policy: | |||
326 | 360 | ||
327 | void xfrm6_fini(void) | 361 | void xfrm6_fini(void) |
328 | { | 362 | { |
363 | #ifdef CONFIG_SYSCTL | ||
364 | if (sysctl_hdr) | ||
365 | unregister_net_sysctl_table(sysctl_hdr); | ||
366 | #endif | ||
329 | //xfrm6_input_fini(); | 367 | //xfrm6_input_fini(); |
330 | xfrm6_policy_fini(); | 368 | xfrm6_policy_fini(); |
331 | xfrm6_state_fini(); | 369 | xfrm6_state_fini(); |