diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-09-27 01:29:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:01:21 -0400 |
commit | d8ed029d6000ba2e2908d9286409e4833c091b4c (patch) | |
tree | 732feaa2e3751df5c81032a30ff4761427492ac4 /net/sunrpc/auth_gss | |
parent | 7699431301b189fca7ccbb64fe54e5a5170f8497 (diff) |
[SUNRPC]: trivial endianness annotations
pure s/u32/__be32/
[AV: large part based on Alexey's patches]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 33 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_seal.c | 2 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_wrap.c | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 24 |
4 files changed, 32 insertions, 31 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 6eed3e166ba3..a6ed2d22a6e6 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -826,14 +826,14 @@ out: | |||
826 | * Marshal credentials. | 826 | * Marshal credentials. |
827 | * Maybe we should keep a cached credential for performance reasons. | 827 | * Maybe we should keep a cached credential for performance reasons. |
828 | */ | 828 | */ |
829 | static u32 * | 829 | static __be32 * |
830 | gss_marshal(struct rpc_task *task, u32 *p) | 830 | gss_marshal(struct rpc_task *task, __be32 *p) |
831 | { | 831 | { |
832 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 832 | struct rpc_cred *cred = task->tk_msg.rpc_cred; |
833 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 833 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
834 | gc_base); | 834 | gc_base); |
835 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 835 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
836 | u32 *cred_len; | 836 | __be32 *cred_len; |
837 | struct rpc_rqst *req = task->tk_rqstp; | 837 | struct rpc_rqst *req = task->tk_rqstp; |
838 | u32 maj_stat = 0; | 838 | u32 maj_stat = 0; |
839 | struct xdr_netobj mic; | 839 | struct xdr_netobj mic; |
@@ -894,12 +894,12 @@ gss_refresh(struct rpc_task *task) | |||
894 | return 0; | 894 | return 0; |
895 | } | 895 | } |
896 | 896 | ||
897 | static u32 * | 897 | static __be32 * |
898 | gss_validate(struct rpc_task *task, u32 *p) | 898 | gss_validate(struct rpc_task *task, __be32 *p) |
899 | { | 899 | { |
900 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 900 | struct rpc_cred *cred = task->tk_msg.rpc_cred; |
901 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 901 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
902 | u32 seq; | 902 | __be32 seq; |
903 | struct kvec iov; | 903 | struct kvec iov; |
904 | struct xdr_buf verf_buf; | 904 | struct xdr_buf verf_buf; |
905 | struct xdr_netobj mic; | 905 | struct xdr_netobj mic; |
@@ -940,13 +940,14 @@ out_bad: | |||
940 | 940 | ||
941 | static inline int | 941 | static inline int |
942 | gss_wrap_req_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | 942 | gss_wrap_req_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, |
943 | kxdrproc_t encode, struct rpc_rqst *rqstp, u32 *p, void *obj) | 943 | kxdrproc_t encode, struct rpc_rqst *rqstp, __be32 *p, void *obj) |
944 | { | 944 | { |
945 | struct xdr_buf *snd_buf = &rqstp->rq_snd_buf; | 945 | struct xdr_buf *snd_buf = &rqstp->rq_snd_buf; |
946 | struct xdr_buf integ_buf; | 946 | struct xdr_buf integ_buf; |
947 | u32 *integ_len = NULL; | 947 | __be32 *integ_len = NULL; |
948 | struct xdr_netobj mic; | 948 | struct xdr_netobj mic; |
949 | u32 offset, *q; | 949 | u32 offset; |
950 | __be32 *q; | ||
950 | struct kvec *iov; | 951 | struct kvec *iov; |
951 | u32 maj_stat = 0; | 952 | u32 maj_stat = 0; |
952 | int status = -EIO; | 953 | int status = -EIO; |
@@ -1032,13 +1033,13 @@ out: | |||
1032 | 1033 | ||
1033 | static inline int | 1034 | static inline int |
1034 | gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | 1035 | gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, |
1035 | kxdrproc_t encode, struct rpc_rqst *rqstp, u32 *p, void *obj) | 1036 | kxdrproc_t encode, struct rpc_rqst *rqstp, __be32 *p, void *obj) |
1036 | { | 1037 | { |
1037 | struct xdr_buf *snd_buf = &rqstp->rq_snd_buf; | 1038 | struct xdr_buf *snd_buf = &rqstp->rq_snd_buf; |
1038 | u32 offset; | 1039 | u32 offset; |
1039 | u32 maj_stat; | 1040 | u32 maj_stat; |
1040 | int status; | 1041 | int status; |
1041 | u32 *opaque_len; | 1042 | __be32 *opaque_len; |
1042 | struct page **inpages; | 1043 | struct page **inpages; |
1043 | int first; | 1044 | int first; |
1044 | int pad; | 1045 | int pad; |
@@ -1095,7 +1096,7 @@ gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | |||
1095 | 1096 | ||
1096 | static int | 1097 | static int |
1097 | gss_wrap_req(struct rpc_task *task, | 1098 | gss_wrap_req(struct rpc_task *task, |
1098 | kxdrproc_t encode, void *rqstp, u32 *p, void *obj) | 1099 | kxdrproc_t encode, void *rqstp, __be32 *p, void *obj) |
1099 | { | 1100 | { |
1100 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1101 | struct rpc_cred *cred = task->tk_msg.rpc_cred; |
1101 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 1102 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
@@ -1132,7 +1133,7 @@ out: | |||
1132 | 1133 | ||
1133 | static inline int | 1134 | static inline int |
1134 | gss_unwrap_resp_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | 1135 | gss_unwrap_resp_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, |
1135 | struct rpc_rqst *rqstp, u32 **p) | 1136 | struct rpc_rqst *rqstp, __be32 **p) |
1136 | { | 1137 | { |
1137 | struct xdr_buf *rcv_buf = &rqstp->rq_rcv_buf; | 1138 | struct xdr_buf *rcv_buf = &rqstp->rq_rcv_buf; |
1138 | struct xdr_buf integ_buf; | 1139 | struct xdr_buf integ_buf; |
@@ -1169,7 +1170,7 @@ gss_unwrap_resp_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | |||
1169 | 1170 | ||
1170 | static inline int | 1171 | static inline int |
1171 | gss_unwrap_resp_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | 1172 | gss_unwrap_resp_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, |
1172 | struct rpc_rqst *rqstp, u32 **p) | 1173 | struct rpc_rqst *rqstp, __be32 **p) |
1173 | { | 1174 | { |
1174 | struct xdr_buf *rcv_buf = &rqstp->rq_rcv_buf; | 1175 | struct xdr_buf *rcv_buf = &rqstp->rq_rcv_buf; |
1175 | u32 offset; | 1176 | u32 offset; |
@@ -1198,13 +1199,13 @@ gss_unwrap_resp_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, | |||
1198 | 1199 | ||
1199 | static int | 1200 | static int |
1200 | gss_unwrap_resp(struct rpc_task *task, | 1201 | gss_unwrap_resp(struct rpc_task *task, |
1201 | kxdrproc_t decode, void *rqstp, u32 *p, void *obj) | 1202 | kxdrproc_t decode, void *rqstp, __be32 *p, void *obj) |
1202 | { | 1203 | { |
1203 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1204 | struct rpc_cred *cred = task->tk_msg.rpc_cred; |
1204 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 1205 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
1205 | gc_base); | 1206 | gc_base); |
1206 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 1207 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
1207 | u32 *savedp = p; | 1208 | __be32 *savedp = p; |
1208 | struct kvec *head = ((struct rpc_rqst *)rqstp)->rq_rcv_buf.head; | 1209 | struct kvec *head = ((struct rpc_rqst *)rqstp)->rq_rcv_buf.head; |
1209 | int savedlen = head->iov_len; | 1210 | int savedlen = head->iov_len; |
1210 | int status = -EIO; | 1211 | int status = -EIO; |
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c index 2f312164d6d5..08601ee4cd73 100644 --- a/net/sunrpc/auth_gss/gss_krb5_seal.c +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c | |||
@@ -115,7 +115,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text, | |||
115 | krb5_hdr = ptr - 2; | 115 | krb5_hdr = ptr - 2; |
116 | msg_start = krb5_hdr + 24; | 116 | msg_start = krb5_hdr + 24; |
117 | 117 | ||
118 | *(u16 *)(krb5_hdr + 2) = htons(ctx->signalg); | 118 | *(__be16 *)(krb5_hdr + 2) = htons(ctx->signalg); |
119 | memset(krb5_hdr + 4, 0xff, 4); | 119 | memset(krb5_hdr + 4, 0xff, 4); |
120 | 120 | ||
121 | if (make_checksum(checksum_type, krb5_hdr, 8, text, 0, &md5cksum)) | 121 | if (make_checksum(checksum_type, krb5_hdr, 8, text, 0, &md5cksum)) |
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c index f179415d0c38..cc45c1605f80 100644 --- a/net/sunrpc/auth_gss/gss_krb5_wrap.c +++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c | |||
@@ -177,9 +177,9 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset, | |||
177 | msg_start = krb5_hdr + 24; | 177 | msg_start = krb5_hdr + 24; |
178 | /* XXXJBF: */ BUG_ON(buf->head[0].iov_base + offset + headlen != msg_start + blocksize); | 178 | /* XXXJBF: */ BUG_ON(buf->head[0].iov_base + offset + headlen != msg_start + blocksize); |
179 | 179 | ||
180 | *(u16 *)(krb5_hdr + 2) = htons(kctx->signalg); | 180 | *(__be16 *)(krb5_hdr + 2) = htons(kctx->signalg); |
181 | memset(krb5_hdr + 4, 0xff, 4); | 181 | memset(krb5_hdr + 4, 0xff, 4); |
182 | *(u16 *)(krb5_hdr + 4) = htons(kctx->sealalg); | 182 | *(__be16 *)(krb5_hdr + 4) = htons(kctx->sealalg); |
183 | 183 | ||
184 | make_confounder(msg_start, blocksize); | 184 | make_confounder(msg_start, blocksize); |
185 | 185 | ||
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index cd3d77ca3a31..a2587e8eef7b 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -640,7 +640,7 @@ svc_safe_putnetobj(struct kvec *resv, struct xdr_netobj *o) | |||
640 | */ | 640 | */ |
641 | static int | 641 | static int |
642 | gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci, | 642 | gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci, |
643 | u32 *rpcstart, struct rpc_gss_wire_cred *gc, u32 *authp) | 643 | __be32 *rpcstart, struct rpc_gss_wire_cred *gc, __be32 *authp) |
644 | { | 644 | { |
645 | struct gss_ctx *ctx_id = rsci->mechctx; | 645 | struct gss_ctx *ctx_id = rsci->mechctx; |
646 | struct xdr_buf rpchdr; | 646 | struct xdr_buf rpchdr; |
@@ -687,7 +687,7 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci, | |||
687 | static int | 687 | static int |
688 | gss_write_null_verf(struct svc_rqst *rqstp) | 688 | gss_write_null_verf(struct svc_rqst *rqstp) |
689 | { | 689 | { |
690 | u32 *p; | 690 | __be32 *p; |
691 | 691 | ||
692 | svc_putnl(rqstp->rq_res.head, RPC_AUTH_NULL); | 692 | svc_putnl(rqstp->rq_res.head, RPC_AUTH_NULL); |
693 | p = rqstp->rq_res.head->iov_base + rqstp->rq_res.head->iov_len; | 693 | p = rqstp->rq_res.head->iov_base + rqstp->rq_res.head->iov_len; |
@@ -701,11 +701,11 @@ gss_write_null_verf(struct svc_rqst *rqstp) | |||
701 | static int | 701 | static int |
702 | gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq) | 702 | gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq) |
703 | { | 703 | { |
704 | u32 xdr_seq; | 704 | __be32 xdr_seq; |
705 | u32 maj_stat; | 705 | u32 maj_stat; |
706 | struct xdr_buf verf_data; | 706 | struct xdr_buf verf_data; |
707 | struct xdr_netobj mic; | 707 | struct xdr_netobj mic; |
708 | u32 *p; | 708 | __be32 *p; |
709 | struct kvec iov; | 709 | struct kvec iov; |
710 | 710 | ||
711 | svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS); | 711 | svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS); |
@@ -782,7 +782,7 @@ EXPORT_SYMBOL(svcauth_gss_register_pseudoflavor); | |||
782 | static inline int | 782 | static inline int |
783 | read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj) | 783 | read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj) |
784 | { | 784 | { |
785 | u32 raw; | 785 | __be32 raw; |
786 | int status; | 786 | int status; |
787 | 787 | ||
788 | status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj)); | 788 | status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj)); |
@@ -905,7 +905,7 @@ struct gss_svc_data { | |||
905 | struct rpc_gss_wire_cred clcred; | 905 | struct rpc_gss_wire_cred clcred; |
906 | /* pointer to the beginning of the procedure-specific results, | 906 | /* pointer to the beginning of the procedure-specific results, |
907 | * which may be encrypted/checksummed in svcauth_gss_release: */ | 907 | * which may be encrypted/checksummed in svcauth_gss_release: */ |
908 | u32 *body_start; | 908 | __be32 *body_start; |
909 | struct rsc *rsci; | 909 | struct rsc *rsci; |
910 | }; | 910 | }; |
911 | 911 | ||
@@ -946,7 +946,7 @@ gss_write_init_verf(struct svc_rqst *rqstp, struct rsi *rsip) | |||
946 | * response here and return SVC_COMPLETE. | 946 | * response here and return SVC_COMPLETE. |
947 | */ | 947 | */ |
948 | static int | 948 | static int |
949 | svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp) | 949 | svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) |
950 | { | 950 | { |
951 | struct kvec *argv = &rqstp->rq_arg.head[0]; | 951 | struct kvec *argv = &rqstp->rq_arg.head[0]; |
952 | struct kvec *resv = &rqstp->rq_res.head[0]; | 952 | struct kvec *resv = &rqstp->rq_res.head[0]; |
@@ -956,8 +956,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp) | |||
956 | struct rpc_gss_wire_cred *gc; | 956 | struct rpc_gss_wire_cred *gc; |
957 | struct rsc *rsci = NULL; | 957 | struct rsc *rsci = NULL; |
958 | struct rsi *rsip, rsikey; | 958 | struct rsi *rsip, rsikey; |
959 | u32 *rpcstart; | 959 | __be32 *rpcstart; |
960 | u32 *reject_stat = resv->iov_base + resv->iov_len; | 960 | __be32 *reject_stat = resv->iov_base + resv->iov_len; |
961 | int ret; | 961 | int ret; |
962 | 962 | ||
963 | dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",argv->iov_len); | 963 | dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",argv->iov_len); |
@@ -1156,7 +1156,7 @@ svcauth_gss_wrap_resp_integ(struct svc_rqst *rqstp) | |||
1156 | struct xdr_buf integ_buf; | 1156 | struct xdr_buf integ_buf; |
1157 | struct xdr_netobj mic; | 1157 | struct xdr_netobj mic; |
1158 | struct kvec *resv; | 1158 | struct kvec *resv; |
1159 | u32 *p; | 1159 | __be32 *p; |
1160 | int integ_offset, integ_len; | 1160 | int integ_offset, integ_len; |
1161 | int stat = -EINVAL; | 1161 | int stat = -EINVAL; |
1162 | 1162 | ||
@@ -1219,7 +1219,7 @@ svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp) | |||
1219 | struct rpc_gss_wire_cred *gc = &gsd->clcred; | 1219 | struct rpc_gss_wire_cred *gc = &gsd->clcred; |
1220 | struct xdr_buf *resbuf = &rqstp->rq_res; | 1220 | struct xdr_buf *resbuf = &rqstp->rq_res; |
1221 | struct page **inpages = NULL; | 1221 | struct page **inpages = NULL; |
1222 | u32 *p; | 1222 | __be32 *p; |
1223 | int offset, *len; | 1223 | int offset, *len; |
1224 | int pad; | 1224 | int pad; |
1225 | 1225 | ||
@@ -1264,7 +1264,7 @@ svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp) | |||
1264 | return -ENOMEM; | 1264 | return -ENOMEM; |
1265 | *len = htonl(resbuf->len - offset); | 1265 | *len = htonl(resbuf->len - offset); |
1266 | pad = 3 - ((resbuf->len - offset - 1)&3); | 1266 | pad = 3 - ((resbuf->len - offset - 1)&3); |
1267 | p = (u32 *)(resbuf->tail[0].iov_base + resbuf->tail[0].iov_len); | 1267 | p = (__be32 *)(resbuf->tail[0].iov_base + resbuf->tail[0].iov_len); |
1268 | memset(p, 0, pad); | 1268 | memset(p, 0, pad); |
1269 | resbuf->tail[0].iov_len += pad; | 1269 | resbuf->tail[0].iov_len += pad; |
1270 | resbuf->len += pad; | 1270 | resbuf->len += pad; |