aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2006-11-27 15:58:20 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:30:49 -0500
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 8dbb38b91de2..006c88c163e0 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)
2113 unsigned char *b; 2113 unsigned char *b;
2114 int len = 0; 2114 int len = 0;
2115#ifdef CONFIG_XFRM_SUB_POLICY 2115#ifdef CONFIG_XFRM_SUB_POLICY
2116 struct xfrm_userpolicy_type upt;
2117 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); 2116 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2118#endif 2117#endif
2119 len += NLMSG_LENGTH(0); 2118 len += NLMSG_LENGTH(0);
@@ -2126,12 +2125,8 @@ static int xfrm_notify_policy_flush(struct km_event *c)
2126 2125
2127 nlh = NLMSG_PUT(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0); 2126 nlh = NLMSG_PUT(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0);
2128 nlh->nlmsg_flags = 0; 2127 nlh->nlmsg_flags = 0;
2129 2128 if (copy_to_user_policy_type(c->data.type, skb) < 0)
2130#ifdef CONFIG_XFRM_SUB_POLICY 2129 goto nlmsg_failure;
2131 memset(&upt, 0, sizeof(upt));
2132 upt.type = c->data.type;
2133 RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt);
2134#endif
2135 2130
2136 nlh->nlmsg_len = skb->tail - b; 2131 nlh->nlmsg_len = skb->tail - b;
2137 2132
@@ -2139,9 +2134,6 @@ static int xfrm_notify_policy_flush(struct km_event *c)
2139 return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC); 2134 return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
2140 2135
2141nlmsg_failure: 2136nlmsg_failure:
2142#ifdef CONFIG_XFRM_SUB_POLICY
2143rtattr_failure:
2144#endif
2145 kfree_skb(skb); 2137 kfree_skb(skb);
2146 return -1; 2138 return -1;
2147} 2139}