aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/xfrm/xfrm_user.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e81e2fb3d429..816e3690b60f 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -272,9 +272,8 @@ static int attach_encap_tmpl(struct xfrm_encap_tmpl **encapp, struct rtattr *u_a
272} 272}
273 273
274 274
275static inline int xfrm_user_sec_ctx_size(struct xfrm_policy *xp) 275static inline int xfrm_user_sec_ctx_size(struct xfrm_sec_ctx *xfrm_ctx)
276{ 276{
277 struct xfrm_sec_ctx *xfrm_ctx = xp->security;
278 int len = 0; 277 int len = 0;
279 278
280 if (xfrm_ctx) { 279 if (xfrm_ctx) {
@@ -2170,7 +2169,7 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
2170 2169
2171 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 2170 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
2172 len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); 2171 len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire));
2173 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 2172 len += RTA_SPACE(xfrm_user_sec_ctx_size(x->security));
2174#ifdef CONFIG_XFRM_SUB_POLICY 2173#ifdef CONFIG_XFRM_SUB_POLICY
2175 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); 2174 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2176#endif 2175#endif
@@ -2280,7 +2279,7 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
2280 2279
2281 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 2280 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
2282 len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); 2281 len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire));
2283 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 2282 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp->security));
2284#ifdef CONFIG_XFRM_SUB_POLICY 2283#ifdef CONFIG_XFRM_SUB_POLICY
2285 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); 2284 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2286#endif 2285#endif