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: nntpd on Sun4 running SunOS 4.0.1 drops core in getifconf() Message-ID: Date: 16 Feb 89 21:22:17 GMT Sender: news@tut.cis.ohio-state.edu Organization: OSU Lines: 82 For the first time for myself, I had to install news with NNTP on a Sun4 running SunOS 4.0.1. I installed news with NNTP on a Sun3/280 running 4.0.1 about a month ago, and it installed and is running just fine. However, apparent hardware peculiarities (byte alignment restrictions, or perhaps a compiler bug) bit me on the Sun4. It was necessary to apply this diff to nntp-1.5/server/subnet.c in order to keep the beastie from dropping a core (8.5Mbytes?!?) when executed. Surely I'm not the first one ever to install nntpd on a Sun4 - did I miss a patch somewhere along the way? --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);