diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 2cbbe5e93a7b..5238f6a8dfad 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -507,8 +507,16 @@ static int copy_to_user_state_extra(struct xfrm_state *x, | |||
507 | struct xfrm_usersa_info *p, | 507 | struct xfrm_usersa_info *p, |
508 | struct sk_buff *skb) | 508 | struct sk_buff *skb) |
509 | { | 509 | { |
510 | spin_lock_bh(&x->lock); | ||
510 | copy_to_user_state(x, p); | 511 | copy_to_user_state(x, p); |
511 | 512 | ||
513 | if (x->coaddr) | ||
514 | NLA_PUT(skb, XFRMA_COADDR, sizeof(*x->coaddr), x->coaddr); | ||
515 | |||
516 | if (x->lastused) | ||
517 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); | ||
518 | spin_unlock_bh(&x->lock); | ||
519 | |||
512 | if (x->aalg) | 520 | if (x->aalg) |
513 | NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); | 521 | NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); |
514 | if (x->ealg) | 522 | if (x->ealg) |
@@ -522,12 +530,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x, | |||
522 | if (x->security && copy_sec_ctx(x->security, skb) < 0) | 530 | if (x->security && copy_sec_ctx(x->security, skb) < 0) |
523 | goto nla_put_failure; | 531 | goto nla_put_failure; |
524 | 532 | ||
525 | if (x->coaddr) | ||
526 | NLA_PUT(skb, XFRMA_COADDR, sizeof(*x->coaddr), x->coaddr); | ||
527 | |||
528 | if (x->lastused) | ||
529 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); | ||
530 | |||
531 | return 0; | 533 | return 0; |
532 | 534 | ||
533 | nla_put_failure: | 535 | nla_put_failure: |