aboutsummaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2006-11-27 12:58:20 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:30:49 -0800
commit0c51f53c57c5584508dfae7110db5caccfd499c6 (patch)
treeda6414e2d013b6c56ba550b93d327a5798f0cb0e /net/xfrm
parent46ca5f5dc4f1c9b5ac02c0090ae8ff4ac8560446 (diff)
[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>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_user.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 8dbb38b91de..006c88c163e 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2113,7 +2113,6 @@ static int xfrm_notify_policy_flush(struct km_event *c)
unsigned char *b;
int len = 0;
#ifdef CONFIG_XFRM_SUB_POLICY
- struct xfrm_userpolicy_type upt;
len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
#endif
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_flags = 0;
-
-#ifdef CONFIG_XFRM_SUB_POLICY
- memset(&upt, 0, sizeof(upt));
- upt.type = c->data.type;
- RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt);
-#endif
+ if (copy_to_user_policy_type(c->data.type, skb) < 0)
+ goto nlmsg_failure;
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);
nlmsg_failure:
-#ifdef CONFIG_XFRM_SUB_POLICY
-rtattr_failure:
-#endif
kfree_skb(skb);
return -1;
}