Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!ames!claris!apple!oracle!newshost!jdiaz From: jdiaz@hqsun1.oracle.com (Jean Marie Diaz) Newsgroups: news.software.nntp Subject: Re: nntpd on Sun4 running SunOS 4.0.1 drops core in getifconf() Message-ID: Date: 17 Feb 89 00:54:39 GMT References: Sender: news@oracle.uucp Organization: Oracle Corporation, Belmont, CA Lines: 53 In-reply-to: karl@triceratops.cis.ohio-state.edu's message of 16 Feb 89 21:22:17 GMT I am extremely grateful to Karl for pointing out what was going on with my nntpd lo these many moons, and to show my gratitude, I'm going to post a patch to his patch -- this to fix similar problems in inet_snetof(). AMBAR ambar@oracle.com {uunet,pyramid}!oracle!ambar *** subnet.c~ Thu Feb 16 16:49:24 1989 --- subnet.c Thu Feb 16 16:45:23 1989 *************** *** 198,206 **** 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; * if so, return subnet number. --- 198,208 ---- 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; * if so, return subnet number. *************** *** 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); --- 214,221 ---- 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);