From: jamal <hadi@cyberus.ca>
To: David Miller <davem@davemloft.net>
Cc: Masahide NAKAMURA <nakam@linux-ipv6.org>, netdev@vger.kernel.org
Subject: [PATCH 1/2][XFRM]: Sub-policies beautification
Date: Fri, 17 Nov 2006 09:10:16 -0500 [thread overview]
Message-ID: <1163772616.5107.40.camel@jzny2> (raw)
[-- Attachment #1: Type: text/plain, Size: 25 bytes --]
First one
cheers,
jamal
[-- Attachment #2: ipsec-subp31 --]
[-- Type: text/plain, Size: 2565 bytes --]
[XFRM]: Make copy_to_user_policy_type take a type
Make copy_to_user_policy_type take a type instead a policy and
fix its users to pass the type
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
commit 5e6a47d1e7baabd38cca9d01f3d78ae1319db535
tree cb4b19b38076cdf545a591ae9d5d6ecd8849c0bc
parent c3d793454ab2a36c2d618d226d7de975ab9b7570
author Jamal Hadi Salim <hadi@cyberus.ca> Fri, 17 Nov 2006 08:52:26 -0500
committer Jamal Hadi Salim <hadi@jzny2.(none)> Fri, 17 Nov 2006 08:52:26 -0500
net/xfrm/xfrm_user.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c4cde57..3c34385 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1082,12 +1082,12 @@ static inline int copy_to_user_sec_ctx(s
}
#ifdef CONFIG_XFRM_SUB_POLICY
-static int copy_to_user_policy_type(struct xfrm_policy *xp, struct sk_buff *skb)
+static int copy_to_user_policy_type(__u8 type, struct sk_buff *skb)
{
struct xfrm_userpolicy_type upt;
memset(&upt, 0, sizeof(upt));
- upt.type = xp->type;
+ upt.type = type;
RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt);
@@ -1098,7 +1098,7 @@ rtattr_failure:
}
#else
-static inline int copy_to_user_policy_type(struct xfrm_policy *xp, struct sk_buff *skb)
+static inline int copy_to_user_policy_type(__u8 type, struct sk_buff *skb)
{
return 0;
}
@@ -1127,7 +1127,7 @@ static int dump_one_policy(struct xfrm_p
goto nlmsg_failure;
if (copy_to_user_sec_ctx(xp, skb))
goto nlmsg_failure;
- if (copy_to_user_policy_type(xp, skb) < 0)
+ if (copy_to_user_policy_type(xp->type, skb) < 0)
goto nlmsg_failure;
nlh->nlmsg_len = skb->tail - b;
@@ -1907,7 +1907,7 @@ static int build_acquire(struct sk_buff
goto nlmsg_failure;
if (copy_to_user_state_sec_ctx(x, skb))
goto nlmsg_failure;
- if (copy_to_user_policy_type(xp, skb) < 0)
+ if (copy_to_user_policy_type(xp->type, skb) < 0)
goto nlmsg_failure;
nlh->nlmsg_len = skb->tail - b;
@@ -2017,7 +2017,7 @@ static int build_polexpire(struct sk_buf
goto nlmsg_failure;
if (copy_to_user_sec_ctx(xp, skb))
goto nlmsg_failure;
- if (copy_to_user_policy_type(xp, skb) < 0)
+ if (copy_to_user_policy_type(xp->type, skb) < 0)
goto nlmsg_failure;
upe->hard = !!hard;
@@ -2096,7 +2096,7 @@ #endif
copy_to_user_policy(xp, p, dir);
if (copy_to_user_tmpl(xp, skb) < 0)
goto nlmsg_failure;
- if (copy_to_user_policy_type(xp, skb) < 0)
+ if (copy_to_user_policy_type(xp->type, skb) < 0)
goto nlmsg_failure;
nlh->nlmsg_len = skb->tail - b;
next reply other threads:[~2006-11-17 14:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-17 14:10 jamal [this message]
2006-11-17 16:42 ` [PATCH 1/2][XFRM]: Sub-policies beautification Thomas Graf
2006-11-17 16:49 ` jamal
2006-11-17 16:52 ` Thomas Graf
2006-11-21 0:51 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1163772616.5107.40.camel@jzny2 \
--to=hadi@cyberus.ca \
--cc=davem@davemloft.net \
--cc=nakam@linux-ipv6.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).