diff options
author | Jamal Hadi Salim <hadi@cyberus.ca> | 2006-11-20 19:51:22 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:14 -0500 |
commit | 1459bb36b12ac52bde68d70e2ba7a6f1f2e8be17 (patch) | |
tree | d79ca995878b9542fb454cd49228be47fc3d7268 /net | |
parent | 746859625d879688adb99f1e5e8108fea876d369 (diff) |
[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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | 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 2ee14f8a1908..6ddb49367c13 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1083,12 +1083,12 @@ static inline int copy_to_user_sec_ctx(struct xfrm_policy *xp, struct sk_buff *s | |||
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | #ifdef CONFIG_XFRM_SUB_POLICY | 1085 | #ifdef CONFIG_XFRM_SUB_POLICY |
1086 | static int copy_to_user_policy_type(struct xfrm_policy *xp, struct sk_buff *skb) | 1086 | static int copy_to_user_policy_type(__u8 type, struct sk_buff *skb) |
1087 | { | 1087 | { |
1088 | struct xfrm_userpolicy_type upt; | 1088 | struct xfrm_userpolicy_type upt; |
1089 | 1089 | ||
1090 | memset(&upt, 0, sizeof(upt)); | 1090 | memset(&upt, 0, sizeof(upt)); |
1091 | upt.type = xp->type; | 1091 | upt.type = type; |
1092 | 1092 | ||
1093 | RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt); | 1093 | RTA_PUT(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt); |
1094 | 1094 | ||
@@ -1099,7 +1099,7 @@ rtattr_failure: | |||
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | #else | 1101 | #else |
1102 | static inline int copy_to_user_policy_type(struct xfrm_policy *xp, struct sk_buff *skb) | 1102 | static inline int copy_to_user_policy_type(__u8 type, struct sk_buff *skb) |
1103 | { | 1103 | { |
1104 | return 0; | 1104 | return 0; |
1105 | } | 1105 | } |
@@ -1128,7 +1128,7 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr | |||
1128 | goto nlmsg_failure; | 1128 | goto nlmsg_failure; |
1129 | if (copy_to_user_sec_ctx(xp, skb)) | 1129 | if (copy_to_user_sec_ctx(xp, skb)) |
1130 | goto nlmsg_failure; | 1130 | goto nlmsg_failure; |
1131 | if (copy_to_user_policy_type(xp, skb) < 0) | 1131 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
1132 | goto nlmsg_failure; | 1132 | goto nlmsg_failure; |
1133 | 1133 | ||
1134 | nlh->nlmsg_len = skb->tail - b; | 1134 | nlh->nlmsg_len = skb->tail - b; |
@@ -1908,7 +1908,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, | |||
1908 | goto nlmsg_failure; | 1908 | goto nlmsg_failure; |
1909 | if (copy_to_user_state_sec_ctx(x, skb)) | 1909 | if (copy_to_user_state_sec_ctx(x, skb)) |
1910 | goto nlmsg_failure; | 1910 | goto nlmsg_failure; |
1911 | if (copy_to_user_policy_type(xp, skb) < 0) | 1911 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
1912 | goto nlmsg_failure; | 1912 | goto nlmsg_failure; |
1913 | 1913 | ||
1914 | nlh->nlmsg_len = skb->tail - b; | 1914 | nlh->nlmsg_len = skb->tail - b; |
@@ -2018,7 +2018,7 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, | |||
2018 | goto nlmsg_failure; | 2018 | goto nlmsg_failure; |
2019 | if (copy_to_user_sec_ctx(xp, skb)) | 2019 | if (copy_to_user_sec_ctx(xp, skb)) |
2020 | goto nlmsg_failure; | 2020 | goto nlmsg_failure; |
2021 | if (copy_to_user_policy_type(xp, skb) < 0) | 2021 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
2022 | goto nlmsg_failure; | 2022 | goto nlmsg_failure; |
2023 | upe->hard = !!hard; | 2023 | upe->hard = !!hard; |
2024 | 2024 | ||
@@ -2097,7 +2097,7 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * | |||
2097 | copy_to_user_policy(xp, p, dir); | 2097 | copy_to_user_policy(xp, p, dir); |
2098 | if (copy_to_user_tmpl(xp, skb) < 0) | 2098 | if (copy_to_user_tmpl(xp, skb) < 0) |
2099 | goto nlmsg_failure; | 2099 | goto nlmsg_failure; |
2100 | if (copy_to_user_policy_type(xp, skb) < 0) | 2100 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
2101 | goto nlmsg_failure; | 2101 | goto nlmsg_failure; |
2102 | 2102 | ||
2103 | nlh->nlmsg_len = skb->tail - b; | 2103 | nlh->nlmsg_len = skb->tail - b; |