[XFRM]: Make flush notifier prettier when subpolicy used
Might as well make flush notifier prettier when subpolicy used Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
46ca5f5dc4
commit
0c51f53c57
1 changed files with 2 additions and 10 deletions
|
@ -2113,7 +2113,6 @@ static int xfrm_notify_policy_flush(struct km_event *c)
|
||||||
unsigned char *b;
|
unsigned char *b;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
#ifdef CONFIG_XFRM_SUB_POLICY
|
#ifdef CONFIG_XFRM_SUB_POLICY
|
||||||
struct xfrm_userpolicy_type upt;
|
|
||||||
len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
|
len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
|
||||||
#endif
|
#endif
|
||||||
len += NLMSG_LENGTH(0);
|
len += NLMSG_LENGTH(0);
|
||||||
|
@ -2126,12 +2125,8 @@ static int xfrm_notify_policy_flush(struct km_event *c)
|
||||||
|
|
||||||
nlh = NLMSG_PUT(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0);
|
nlh = NLMSG_PUT(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0);
|
||||||
nlh->nlmsg_flags = 0;
|
nlh->nlmsg_flags = 0;
|
||||||
|
if (copy_to_user_policy_type(c->data.type, skb) < 0)
|
||||||
#ifdef CONFIG_XFRM_SUB_POLICY
|
goto nlmsg_failure;
|
||||||
memset(&upt, 0, sizeof(upt));
|
|
||||||
upt.type = c->data.type;
|
|
||||||
RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nlh->nlmsg_len = skb->tail - b;
|
nlh->nlmsg_len = skb->tail - b;
|
||||||
|
|
||||||
|
@ -2139,9 +2134,6 @@ static int xfrm_notify_policy_flush(struct km_event *c)
|
||||||
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
|
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
|
||||||
|
|
||||||
nlmsg_failure:
|
nlmsg_failure:
|
||||||
#ifdef CONFIG_XFRM_SUB_POLICY
|
|
||||||
rtattr_failure:
|
|
||||||
#endif
|
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue