Use u_int32_t for sin_addr.s_addr rather than u_long to avoid

unaligned access on alpha.
This commit is contained in:
Hidetoshi Shimokawa 1999-04-13 16:26:21 +00:00
parent 76fcfc1aba
commit 9d3c09b69f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45656

View File

@ -29,7 +29,7 @@
#ifndef lint
static const char rcsid[] =
"$Id: ypbind.c,v 1.27 1998/01/19 23:31:38 wpaul Exp $";
"$Id: ypbind.c,v 1.28 1999/02/10 20:04:22 wpaul Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -230,7 +230,7 @@ rejecting.", *argp);
res.ypbind_status = YPBIND_SUCC_VAL;
res.ypbind_resp_u.ypbind_error = 0; /* Success */
*(u_long *)&res.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr =
*(u_int32_t *)&res.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr =
ypdb->dom_server_addr.sin_addr.s_addr;
*(u_short *)&res.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port =
ypdb->dom_server_addr.sin_port;
@ -283,7 +283,7 @@ rejecting.", argp->ypsetdom_domain);
bzero((char *)&bindsin, sizeof bindsin);
bindsin.sin_family = AF_INET;
bindsin.sin_addr.s_addr = *(u_long *)argp->ypsetdom_binding.ypbind_binding_addr;
bindsin.sin_addr.s_addr = *(u_int32_t *)argp->ypsetdom_binding.ypbind_binding_addr;
bindsin.sin_port = *(u_short *)argp->ypsetdom_binding.ypbind_binding_port;
rpc_received(argp->ypsetdom_domain, &bindsin, 1);
@ -946,7 +946,7 @@ int force;
bzero(&ybr, sizeof ybr);
ybr.ypbind_status = YPBIND_SUCC_VAL;
*(u_long *)&ybr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr = raddrp->sin_addr.s_addr;
*(u_int32_t *)&ybr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr = raddrp->sin_addr.s_addr;
*(u_short *)&ybr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port = raddrp->sin_port;
if( writev(ypdb->dom_lockfd, iov, 2) != iov[0].iov_len + iov[1].iov_len) {