aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netns/xfrm.h2
-rw-r--r--include/net/xfrm.h7
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
51extern struct sock *xfrm_nl;
52extern u32 sysctl_xfrm_aevent_etime; 51extern u32 sysctl_xfrm_aevent_etime;
53extern u32 sysctl_xfrm_aevent_rseqth; 52extern u32 sysctl_xfrm_aevent_rseqth;
54extern int sysctl_xfrm_larval_drop; 53extern 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
1519static inline int xfrm_aevent_is_on(void) 1518#ifdef CONFIG_XFRM
1519static 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
1532static inline int xfrm_alg_len(struct xfrm_algo *alg) 1533static inline int xfrm_alg_len(struct xfrm_algo *alg)
1533{ 1534{