diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-25 20:38:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 20:38:20 -0500 |
commit | a6483b790f8efcd8db190c1c0ff93f9d9efe919a (patch) | |
tree | e05ba1d3e7014409a69d878bf9f24c5eb93365e4 /include | |
parent | bd235e3cfff617ff91677da553714051866ba55f (diff) |
netns xfrm: per-netns NETLINK_XFRM socket
Stub senders to init_net's one temporarily.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netns/xfrm.h | 2 | ||||
-rw-r--r-- | include/net/xfrm.h | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index c53d17357a49..09f3060e9d18 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -39,6 +39,8 @@ struct netns_xfrm { | |||
39 | struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2]; | 39 | struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2]; |
40 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; | 40 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; |
41 | struct work_struct policy_hash_work; | 41 | struct work_struct policy_hash_work; |
42 | |||
43 | struct sock *nlsk; | ||
42 | }; | 44 | }; |
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bd2515005ae2..e027179e8199 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -48,7 +48,6 @@ DECLARE_SNMP_STAT(struct linux_xfrm_mib, xfrm_statistics); | |||
48 | #define XFRM_INC_STATS_USER(field) | 48 | #define XFRM_INC_STATS_USER(field) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | extern struct sock *xfrm_nl; | ||
52 | extern u32 sysctl_xfrm_aevent_etime; | 51 | extern u32 sysctl_xfrm_aevent_etime; |
53 | extern u32 sysctl_xfrm_aevent_rseqth; | 52 | extern u32 sysctl_xfrm_aevent_rseqth; |
54 | extern int sysctl_xfrm_larval_drop; | 53 | extern int sysctl_xfrm_larval_drop; |
@@ -1516,18 +1515,20 @@ static inline int xfrm_policy_id2dir(u32 index) | |||
1516 | return index & 7; | 1515 | return index & 7; |
1517 | } | 1516 | } |
1518 | 1517 | ||
1519 | static inline int xfrm_aevent_is_on(void) | 1518 | #ifdef CONFIG_XFRM |
1519 | static inline int xfrm_aevent_is_on(struct net *net) | ||
1520 | { | 1520 | { |
1521 | struct sock *nlsk; | 1521 | struct sock *nlsk; |
1522 | int ret = 0; | 1522 | int ret = 0; |
1523 | 1523 | ||
1524 | rcu_read_lock(); | 1524 | rcu_read_lock(); |
1525 | nlsk = rcu_dereference(xfrm_nl); | 1525 | nlsk = rcu_dereference(net->xfrm.nlsk); |
1526 | if (nlsk) | 1526 | if (nlsk) |
1527 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | 1527 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); |
1528 | rcu_read_unlock(); | 1528 | rcu_read_unlock(); |
1529 | return ret; | 1529 | return ret; |
1530 | } | 1530 | } |
1531 | #endif | ||
1531 | 1532 | ||
1532 | static inline int xfrm_alg_len(struct xfrm_algo *alg) | 1533 | static inline int xfrm_alg_len(struct xfrm_algo *alg) |
1533 | { | 1534 | { |