* [PATCH 2/2][XFRM]: Sub-policies beautification
@ 2006-11-17 14:14 jamal
0 siblings, 0 replies; only message in thread
From: jamal @ 2006-11-17 14:14 UTC (permalink / raw)
To: David Miller; +Cc: Masahide NAKAMURA, netdev
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Second one ..
cheers,
jamal
[-- Attachment #2: ipsec-subp32 --]
[-- Type: text/plain, Size: 1566 bytes --]
[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>
---
commit eb52e3df145c2f8676da51a21cbe664d7794949c
tree d51daec2222f0feb1119f7c00bf9949b255a9494
parent 5e6a47d1e7baabd38cca9d01f3d78ae1319db535
author Jamal Hadi Salim <hadi@cyberus.ca> Fri, 17 Nov 2006 08:56:34 -0500
committer Jamal Hadi Salim <hadi@jzny2.(none)> Fri, 17 Nov 2006 08:56:34 -0500
net/xfrm/xfrm_user.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 3c34385..793b241 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2117,7 +2117,6 @@ static int xfrm_notify_policy_flush(stru
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);
@@ -2130,12 +2129,8 @@ #endif
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;
@@ -2143,9 +2138,6 @@ #endif
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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-17 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-17 14:14 [PATCH 2/2][XFRM]: Sub-policies beautification jamal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).