Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!triceratops.cis.ohio-state.edu!karl From: karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) Newsgroups: news.software.nntp Subject: Re: NNTP 1.5 problems on a Sun 4 Message-ID: Date: 25 Jul 89 20:09:56 GMT References: <226@auto-trol.UUCP> Sender: news@tut.cis.ohio-state.edu Distribution: na Organization: OSU Lines: 81 In-reply-to: andhal@auto-trol.UUCP's message of 25 Jul 89 15:08:23 GMT andhal@auto-trol.uucp writes: I'm having trouble installing nntp on a Sun 4, SunOS 4.0.1 Install this patch, if you haven't already. It corrects problems caused by a too-lenient equivalence of long with struct inaddr. On a Sun4, a struct inaddr is 8(?) bytes long. I first posted this last February, but I don't think it's showing up in current NNTP distributions. --Karl *** subnet.c~ Thu Feb 16 15:41:10 1989 --- subnet.c Thu Feb 16 16:15:00 1989 *************** *** 90,95 **** --- 90,96 ---- register struct ifreq *ifr; u_long inet_netof(); u_long addr; + struct in_addr duh; /* * Find out how many interfaces we have, and malloc *************** *** 134,140 **** if (ifr->ifr_addr.sa_family != AF_INET) continue; addr = (*(struct sockaddr_in *)&ifr->ifr_addr).sin_addr.s_addr; ! in_ifsni[j].i_net = inet_netof(addr); if (ioctl(s, SIOCGIFNETMASK, ifr) < 0) continue; in_ifsni[j].i_subnetmask = --- 135,142 ---- if (ifr->ifr_addr.sa_family != AF_INET) continue; addr = (*(struct sockaddr_in *)&ifr->ifr_addr).sin_addr.s_addr; ! duh.s_addr = addr; ! in_ifsni[j].i_net = inet_netof(duh); if (ioctl(s, SIOCGIFNETMASK, ifr) < 0) continue; in_ifsni[j].i_subnetmask = *************** *** 198,205 **** register u_long i = ntohl(in); register u_long net; u_long inet_netof(), inet_lnaof(); ! net = inet_netof(in); /* * Check whether network is a subnet; --- 200,209 ---- register u_long i = ntohl(in); register u_long net; u_long inet_netof(), inet_lnaof(); + struct in_addr duh; ! duh.s_addr = in; ! net = inet_netof(duh); /* * Check whether network is a subnet; *************** *** 212,218 **** if (net == in_ifsni[j].i_net) { #endif net = i & in_ifsni[j].i_subnetmask; ! if (inet_lnaof(htonl(net)) == 0) return (0); else return (net >> in_ifsni[j].i_bitshift); --- 216,223 ---- if (net == in_ifsni[j].i_net) { #endif net = i & in_ifsni[j].i_subnetmask; ! duh.s_addr = htonl(net); ! if (inet_lnaof(duh) == 0) return (0); else return (net >> in_ifsni[j].i_bitshift);