aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-25 20:51:01 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 20:51:01 -0500
commitdb983c1144884cab10d6397532f4bf05eb0c01d2 (patch)
treeebb86abdaeb916191424407881d52635019502cf
parent7067802e262457a9737521e5669b622028b2283a (diff)
netns xfrm: KM reporting in netns
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/xfrm.h4
-rw-r--r--net/ipv6/mip6.c3
-rw-r--r--net/xfrm/xfrm_state.c4
-rw-r--r--net/xfrm/xfrm_user.c5
4 files changed, 8 insertions, 8 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 52e784fa2c50..f3ea1607c595 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -552,7 +552,7 @@ struct xfrm_mgr
552 struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); 552 struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir);
553 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 553 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
554 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); 554 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c);
555 int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); 555 int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
556 int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k); 556 int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k);
557}; 557};
558 558
@@ -1471,7 +1471,7 @@ extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1471 1471
1472extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1472extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
1473extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); 1473extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid);
1474extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); 1474extern int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
1475 1475
1476extern void xfrm_input_init(void); 1476extern void xfrm_input_init(void);
1477extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); 1477extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq);
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 31295c8f6196..f995e19c87a9 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -205,6 +205,7 @@ static inline int mip6_report_rl_allow(struct timeval *stamp,
205 205
206static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct flowi *fl) 206static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct flowi *fl)
207{ 207{
208 struct net *net = xs_net(x);
208 struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb; 209 struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb;
209 struct ipv6_destopt_hao *hao = NULL; 210 struct ipv6_destopt_hao *hao = NULL;
210 struct xfrm_selector sel; 211 struct xfrm_selector sel;
@@ -247,7 +248,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct
247 sel.sport_mask = htons(~0); 248 sel.sport_mask = htons(~0);
248 sel.ifindex = fl->oif; 249 sel.ifindex = fl->oif;
249 250
250 err = km_report(IPPROTO_DSTOPTS, &sel, 251 err = km_report(net, IPPROTO_DSTOPTS, &sel,
251 (hao ? (xfrm_address_t *)&hao->addr : NULL)); 252 (hao ? (xfrm_address_t *)&hao->addr : NULL));
252 253
253 out: 254 out:
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 21db37ab0a2f..d594b5af5f6b 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1833,7 +1833,7 @@ int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1833EXPORT_SYMBOL(km_migrate); 1833EXPORT_SYMBOL(km_migrate);
1834#endif 1834#endif
1835 1835
1836int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr) 1836int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
1837{ 1837{
1838 int err = -EINVAL; 1838 int err = -EINVAL;
1839 int ret; 1839 int ret;
@@ -1842,7 +1842,7 @@ int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
1842 read_lock(&xfrm_km_lock); 1842 read_lock(&xfrm_km_lock);
1843 list_for_each_entry(km, &xfrm_km_list, list) { 1843 list_for_each_entry(km, &xfrm_km_list, list) {
1844 if (km->report) { 1844 if (km->report) {
1845 ret = km->report(proto, sel, addr); 1845 ret = km->report(net, proto, sel, addr);
1846 if (!ret) 1846 if (!ret)
1847 err = ret; 1847 err = ret;
1848 } 1848 }
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 3e32ec2ea1ad..b7240d5b77ad 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2520,10 +2520,9 @@ nla_put_failure:
2520 return -EMSGSIZE; 2520 return -EMSGSIZE;
2521} 2521}
2522 2522
2523static int xfrm_send_report(u8 proto, struct xfrm_selector *sel, 2523static int xfrm_send_report(struct net *net, u8 proto,
2524 xfrm_address_t *addr) 2524 struct xfrm_selector *sel, xfrm_address_t *addr)
2525{ 2525{
2526 struct net *net = &init_net;
2527 struct sk_buff *skb; 2526 struct sk_buff *skb;
2528 2527
2529 skb = nlmsg_new(xfrm_report_msgsize(), GFP_ATOMIC); 2528 skb = nlmsg_new(xfrm_report_msgsize(), GFP_ATOMIC);