Patch #: 21 Type: bug fix Priority: low Affects: sites using UAB/ethertalk on some little-endian hosts Reported: John Willain Dunn Archived: munnari.OZ.AU mac/cap.patches/cap60.patch021 Summary: missing htons() File: cap60/support/ethertalk/senetp.c File: cap60/support/ethertalk/snitp.c File: cap60/support/uab/senetp.c File: cap60/support/uab/snitp.c *** support/ethertalk/senetp.c.orig Sat May 18 17:23:58 1991 --- support/ethertalk/senetp.c Sat May 18 17:50:12 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 91/03/13 20:14:31 $"; ! static char rcsident[] = "$Header: senetp.c,v 2.2 91/03/13 20:14:31 djh Exp $"; ! static char revision[] = "$Revision: 2.2 $"; /* * senetp.c - Simple "protocol" level interface to enet --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/18 07:49:53 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/senetp.c,v 2.3 1991/05/18 07:49:53 djh Exp djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * senetp.c - Simple "protocol" level interface to enet *************** *** 281,287 **** register u_short *fwp = pf.enf_Filter; extern int errno; ! ethert = prot; #ifdef EIOCETHERT if (ioctl(s, EIOCETHERT, ðert) < 0 && errno != EEXIST ) { perror("ioctl: protocol filter"); --- 281,287 ---- register u_short *fwp = pf.enf_Filter; extern int errno; ! ethert = htons(prot); #ifdef EIOCETHERT if (ioctl(s, EIOCETHERT, ðert) < 0 && errno != EEXIST ) { perror("ioctl: protocol filter"); *************** *** 480,486 **** return(-1); bcopy(eaddr, &eh.ether_dhost, 6); ! eh.ether_type = eph->protocol; if (writev(eph->fd, iov, 2) < 0) { return(-1); --- 480,486 ---- return(-1); bcopy(eaddr, &eh.ether_dhost, 6); ! eh.ether_type = htons(eph->protocol); if (writev(eph->fd, iov, 2) < 0) { return(-1); *** support/ethertalk/snitp.c.orig Sat May 18 17:24:09 1991 --- support/ethertalk/snitp.c Sat May 18 17:51:38 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 91/02/15 23:06:10 $"; ! static char rcsident[] = "$Header: snitp.c,v 2.1 91/02/15 23:06:10 djh Rel $"; ! static char revision[] = "$Revision: 2.1 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/18 07:51:28 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/snitp.c,v 2.2 1991/05/18 07:51:28 djh Exp djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT *************** *** 147,154 **** /* * Initialize nit on a particular protocol type * - * Runs in promiscous mode for now. - * * Return: socket if no error, < 0 o.w. */ private int --- 147,152 ---- *************** *** 432,438 **** sa.sa_family = AF_UNSPEC; /* by def. */ eh = (struct ether_header *)sa.sa_data; /* make pointer */ bcopy(eaddr, &eh->ether_dhost, sizeof(eh->ether_dhost)); ! eh->ether_type = eph->protocol; pbuf.len = sizeof(sa); pbuf.buf = (char *)&sa; dbuf.len = buflen; --- 430,436 ---- sa.sa_family = AF_UNSPEC; /* by def. */ eh = (struct ether_header *)sa.sa_data; /* make pointer */ bcopy(eaddr, &eh->ether_dhost, sizeof(eh->ether_dhost)); ! eh->ether_type = htons(eph->protocol); pbuf.len = sizeof(sa); pbuf.buf = (char *)&sa; dbuf.len = buflen; *** support/uab/senetp.c.orig Sat May 18 17:39:46 1991 --- support/uab/senetp.c Sat May 18 17:58:10 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 91/02/15 23:07:54 $"; ! static char rcsident[] = "$Header: senetp.c,v 2.1 91/02/15 23:07:54 djh Rel $"; ! static char revision[] = "$Revision: 2.1 $"; /* * senetp.c - Simple "protocol" level interface to enet --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/18 07:57:59 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/senetp.c,v 2.2 1991/05/18 07:57:59 djh Exp djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * senetp.c - Simple "protocol" level interface to enet *************** *** 230,236 **** register u_short *fwp = pf.enf_Filter; extern int errno; ! ethert = prot; if (ioctl(s, EIOCETHERT, ðert) < 0 && errno != EEXIST ) { perror("ioctl: protocol filter"); return(-1); --- 230,236 ---- register u_short *fwp = pf.enf_Filter; extern int errno; ! ethert = htons(prot); if (ioctl(s, EIOCETHERT, ðert) < 0 && errno != EEXIST ) { perror("ioctl: protocol filter"); return(-1); *************** *** 364,370 **** return(-1); bcopy(eaddr, &eh.ether_dhost, 6); ! eh.ether_type = eph->protocol; if (writev(eph->socket, iov, 2) < 0) { return(-1); --- 364,370 ---- return(-1); bcopy(eaddr, &eh.ether_dhost, 6); ! eh.ether_type = htons(eph->protocol); if (writev(eph->socket, iov, 2) < 0) { return(-1); *** support/uab/snitp.c.orig Sat May 18 17:39:57 1991 --- support/uab/snitp.c Sat May 18 18:00:41 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 91/02/15 23:07:56 $"; ! static char rcsident[] = "$Header: snitp.c,v 2.1 91/02/15 23:07:56 djh Rel $"; ! static char revision[] = "$Revision: 2.1 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/18 08:00:28 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/snitp.c,v 2.2 1991/05/18 08:00:28 djh Exp djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT *************** *** 146,153 **** /* * Initialize nit on a particular protocol type * - * Runs in promiscous mode for now. - * * Return: socket if no error, < 0 o.w. */ private int --- 146,151 ---- *************** *** 367,373 **** sa.sa_family = AF_UNSPEC; /* by def. */ eh = (struct ether_header *)sa.sa_data; /* make pointer */ bcopy(eaddr, &eh->ether_dhost, sizeof(eh->ether_dhost)); ! eh->ether_type = eph->protocol; pbuf.len = sizeof(sa); pbuf.buf = (char *)&sa; dbuf.len = buflen; --- 365,371 ---- sa.sa_family = AF_UNSPEC; /* by def. */ eh = (struct ether_header *)sa.sa_data; /* make pointer */ bcopy(eaddr, &eh->ether_dhost, sizeof(eh->ether_dhost)); ! eh->ether_type = htons(eph->protocol); pbuf.len = sizeof(sa); pbuf.buf = (char *)&sa; dbuf.len = buflen; *** README.orig Sat May 18 18:13:50 1991 --- README Sat May 18 18:14:19 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 20, May 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 21, May 1991 Introduction ------------