diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d516845e16e3..cb65d916a345 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -896,7 +896,8 @@ static int xfrm_dump_sa_done(struct netlink_callback *cb) | |||
896 | struct sock *sk = cb->skb->sk; | 896 | struct sock *sk = cb->skb->sk; |
897 | struct net *net = sock_net(sk); | 897 | struct net *net = sock_net(sk); |
898 | 898 | ||
899 | xfrm_state_walk_done(walk, net); | 899 | if (cb->args[0]) |
900 | xfrm_state_walk_done(walk, net); | ||
900 | return 0; | 901 | return 0; |
901 | } | 902 | } |
902 | 903 | ||
@@ -921,8 +922,6 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
921 | u8 proto = 0; | 922 | u8 proto = 0; |
922 | int err; | 923 | int err; |
923 | 924 | ||
924 | cb->args[0] = 1; | ||
925 | |||
926 | err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, | 925 | err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, |
927 | xfrma_policy); | 926 | xfrma_policy); |
928 | if (err < 0) | 927 | if (err < 0) |
@@ -939,6 +938,7 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
939 | proto = nla_get_u8(attrs[XFRMA_PROTO]); | 938 | proto = nla_get_u8(attrs[XFRMA_PROTO]); |
940 | 939 | ||
941 | xfrm_state_walk_init(walk, proto, filter); | 940 | xfrm_state_walk_init(walk, proto, filter); |
941 | cb->args[0] = 1; | ||
942 | } | 942 | } |
943 | 943 | ||
944 | (void) xfrm_state_walk(net, walk, dump_one_state, &info); | 944 | (void) xfrm_state_walk(net, walk, dump_one_state, &info); |
@@ -2051,9 +2051,6 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2051 | if (up->hard) { | 2051 | if (up->hard) { |
2052 | xfrm_policy_delete(xp, p->dir); | 2052 | xfrm_policy_delete(xp, p->dir); |
2053 | xfrm_audit_policy_delete(xp, 1, true); | 2053 | xfrm_audit_policy_delete(xp, 1, true); |
2054 | } else { | ||
2055 | // reset the timers here? | ||
2056 | WARN(1, "Don't know what to do with soft policy expire\n"); | ||
2057 | } | 2054 | } |
2058 | km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); | 2055 | km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); |
2059 | 2056 | ||
@@ -2117,7 +2114,7 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2117 | 2114 | ||
2118 | err = verify_newpolicy_info(&ua->policy); | 2115 | err = verify_newpolicy_info(&ua->policy); |
2119 | if (err) | 2116 | if (err) |
2120 | goto bad_policy; | 2117 | goto free_state; |
2121 | 2118 | ||
2122 | /* build an XP */ | 2119 | /* build an XP */ |
2123 | xp = xfrm_policy_construct(net, &ua->policy, attrs, &err); | 2120 | xp = xfrm_policy_construct(net, &ua->policy, attrs, &err); |
@@ -2149,8 +2146,6 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2149 | 2146 | ||
2150 | return 0; | 2147 | return 0; |
2151 | 2148 | ||
2152 | bad_policy: | ||
2153 | WARN(1, "BAD policy passed\n"); | ||
2154 | free_state: | 2149 | free_state: |
2155 | kfree(x); | 2150 | kfree(x); |
2156 | nomem: | 2151 | nomem: |