misc_rpc.c (82794) | misc_rpc.c (119679) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1997-2001 Erez Zadok | 2 * Copyright (c) 1997-2003 Erez Zadok |
3 * Copyright (c) 1990 Jan-Simon Pendry 4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1990 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by 9 * Jan-Simon Pendry at Imperial College, London. 10 * --- 22 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * | 3 * Copyright (c) 1990 Jan-Simon Pendry 4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1990 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by 9 * Jan-Simon Pendry at Imperial College, London. 10 * --- 22 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * |
41 * $Id: misc_rpc.c,v 1.4.2.1 2001/01/10 03:23:39 ezk Exp $ | 41 * $Id: misc_rpc.c,v 1.4.2.5 2002/12/29 00:46:43 ib42 Exp $ |
42 * 43 */ 44 45/* 46 * Additions to Sun RPC. 47 */ 48 49#ifdef HAVE_CONFIG_H --- 72 unchanged lines hidden (view full) --- 122} 123 124 125int 126make_rpc_packet(char *buf, int buflen, u_long proc, struct rpc_msg *mp, voidp arg, XDRPROC_T_TYPE arg_xdr, AUTH *auth) 127{ 128 XDR msg_xdr; 129 int len; | 42 * 43 */ 44 45/* 46 * Additions to Sun RPC. 47 */ 48 49#ifdef HAVE_CONFIG_H --- 72 unchanged lines hidden (view full) --- 122} 123 124 125int 126make_rpc_packet(char *buf, int buflen, u_long proc, struct rpc_msg *mp, voidp arg, XDRPROC_T_TYPE arg_xdr, AUTH *auth) 127{ 128 XDR msg_xdr; 129 int len; |
130 /* 131 * Never cast pointers between different integer types, it breaks badly 132 * on big-endian platforms if those types have different sizes. 133 * 134 * Cast to a local variable instead, and use that variable's address. 135 */ 136 enum_t local_proc = (enum_t) proc; |
|
130 131 xdrmem_create(&msg_xdr, buf, buflen, XDR_ENCODE); 132 133 /* 134 * Basic protocol header 135 */ 136 if (!xdr_callhdr(&msg_xdr, mp)) 137 return -EIO; 138 139 /* 140 * Called procedure number 141 */ | 137 138 xdrmem_create(&msg_xdr, buf, buflen, XDR_ENCODE); 139 140 /* 141 * Basic protocol header 142 */ 143 if (!xdr_callhdr(&msg_xdr, mp)) 144 return -EIO; 145 146 /* 147 * Called procedure number 148 */ |
142 if (!xdr_enum(&msg_xdr, (enum_t *) & proc)) | 149 if (!xdr_enum(&msg_xdr, &local_proc)) |
143 return -EIO; 144 145 /* 146 * Authorization 147 */ 148 if (!AUTH_MARSHALL(auth, &msg_xdr)) 149 return -EIO; 150 --- 54 unchanged lines hidden --- | 150 return -EIO; 151 152 /* 153 * Authorization 154 */ 155 if (!AUTH_MARSHALL(auth, &msg_xdr)) 156 return -EIO; 157 --- 54 unchanged lines hidden --- |