Patch #: 52 Type: bug fix Priority: high Affects: sites wishing to use Phase 2 with SunOS 4.0.3 and NIT Reported: David Hornsby Archived: munnari.OZ.AU mac/cap.patches/cap60.patch052 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch052' Summary: open a temporary socket for SIOCADDMULTI ioctl() File: cap60/support/ethertalk/snitp.c *** support/ethertalk/snitp.c.orig Wed Jul 10 22:42:54 1991 --- support/ethertalk/snitp.c Wed Aug 28 03:09:42 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/07/10 12:42:20 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/snitp.c,v 2.6 1991/07/10 12:42:20 djh Rel djh $"; ! static char revision[] = "$Revision: 2.6 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/08/27 17:09:17 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/ethertalk/RCS/snitp.c,v 2.7 1991/08/27 17:09:17 djh Rel djh $"; ! static char revision[] = "$Revision: 2.7 $"; /* * snitp.c - Simple "protocol" level interface to Streams based NIT *************** *** 208,213 **** --- 208,214 ---- char *multi; struct ifreq *ifr; { + int sock; struct strioctl si; if (s < 0) { *************** *** 235,244 **** } ifr->ifr_addr.sa_family = AF_UNSPEC; bcopy(multi, ifr->ifr_addr.sa_data, EHRD); ! if (ioctl(s, SIOCADDMULTI, (caddr_t)ifr) < 0) { ! perror(DEV_NIT); return(-1); } return(s); } #endif PHASE2 --- 236,255 ---- } ifr->ifr_addr.sa_family = AF_UNSPEC; bcopy(multi, ifr->ifr_addr.sa_data, EHRD); ! /* ! * open a socket, temporarily, to use for SIOC* ioctls ! * ! */ ! if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ! perror("socket()"); return(-1); } + if (ioctl(sock, SIOCADDMULTI, (caddr_t)ifr) < 0) { + perror("SIOCADDMULTI"); + close(sock); + return(-1); + } + close(sock); return(s); } #endif PHASE2 *** README.orig Wed Aug 28 03:10:30 1991 --- README Wed Aug 28 03:11:17 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 51, August 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 52, August 1991 Introduction ------------