From edith!cmcl2!rutgers!cs.utexas.edu!uunet!ibmpa!bullhead!brunner Tue Dec 5 15:00:49 EST 1989 Article 2008 of comp.sys.ibm.pc.rt: Path: edith!cmcl2!rutgers!cs.utexas.edu!uunet!ibmpa!bullhead!brunner >From: brunner@bullhead.uucp Newsgroups: comp.sys.ibm.pc.rt Subject: Patch for NFS utilities Summary: fixes byte alignment (intermittent errors) Keywords: V1.24 nfs byte alignment Message-ID: <3173@ibmpa.UUCP> Date: 4 Dec 89 18:29:34 GMT References: <3171@ibmpa.UUCP> Sender: news@ibmpa.UUCP Reply-To: brunner@ibmsupt.UUCP () Organization: IBM AWD Palo Alto Lines: 104 Subject: Patch for nfs utilities Index: /usr/src/nfs IBM/4.3 Description: Byte alignment errors result in occasional intermittent errors in several nfs applications. Fix: Change directories to /usr/src/nfs and apply the following patch, e.g., patch -p1 < this_file diff -r -c nfs.dist/etc/spray.c nfs.fixed/etc/spray.c *** nfs.dist/etc/spray.c Fri Dec 9 11:48:37 1988 --- nfs.fixed/etc/spray.c Mon Nov 27 10:21:05 1989 *************** *** 108,114 **** --- 108,119 ---- fprintf(stderr, "%s is unknown host name\n", host); exit(1); } + #ifdef ibm032 + memcpy(&adr,hp->h_addr,4); + #else + adr = *((int *)hp->h_addr); + #endif ibm032 } if (icmp) doicmp(adr, delay); diff -r -c nfs.dist/etc/yp/yppoll.c nfs.fixed/etc/yp/yppoll.c *** nfs.dist/etc/yp/yppoll.c Fri Dec 9 11:47:39 1988 --- nfs.fixed/etc/yp/yppoll.c Mon Nov 27 10:22:07 1989 *************** *** 275,281 **** --- 275,285 ---- exit(1); } + #ifdef ibm032 + memcpy(&host_addr.s_addr, hp->h_addr, 4); + #else host_addr.s_addr = *(u_long *)hp->h_addr; + #endif ibm032 } void diff -r -c nfs.dist/etc/yp/yppush.c nfs.fixed/etc/yp/yppush.c *** nfs.dist/etc/yp/yppush.c Fri Dec 9 11:47:42 1988 --- nfs.fixed/etc/yp/yppush.c Mon Nov 27 10:22:18 1989 *************** *** 419,426 **** --- 419,431 ---- ps->oldvers = FALSE; if (h = (struct hostent *) gethostbyname(name) ) { + #ifdef ibm032 + memcpy(&ps->domb.dom_server_addr.sin_addr, + h->h_addr, 4); + #else ps->domb.dom_server_addr.sin_addr = *((struct in_addr *) h->h_addr); + #endif ibm032 ps->domb.dom_server_addr.sin_family = AF_INET; ps->domb.dom_server_addr.sin_port = 0; ps->domb.dom_server_port = 0; diff -r -c nfs.dist/ucb/rusers.c nfs.fixed/ucb/rusers.c *** nfs.dist/ucb/rusers.c Fri Dec 9 11:48:47 1988 --- nfs.fixed/ucb/rusers.c Mon Nov 27 10:23:12 1989 *************** *** 170,176 **** --- 170,180 ---- fprintf("Yikes!: can't find host name!\n"); exit(1); } + #ifdef ibm032 + memcpy( (caddr_t)&addr.sin_addr,hp->h_addr,4); + #else addr.sin_addr.s_addr = *(int *)hp->h_addr; + #endif ibm032 collectnames(&utmpidlearr, &addr); return; } diff -r -c nfs.dist/usr.bin/ypwhich.c nfs.fixed/usr.bin/ypwhich.c *** nfs.dist/usr.bin/ypwhich.c Fri Dec 9 11:49:14 1988 --- nfs.fixed/usr.bin/ypwhich.c Mon Nov 27 10:24:09 1989 *************** *** 378,384 **** --- 378,388 ---- exit(1); } + #ifdef ibm032 + memcpy(&host_addr.s_addr, hp->h_addr, 4); + #else host_addr.s_addr = *(u_long *)hp->h_addr; + #endif ibm032 } /* Eric Brunner, Consultant, IBM AWD Palo Alto (415) 855-4486 inet: brunner@monet.berkeley.edu uucp: uunet!ibmsupt!brunner