🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #251

Re: NNTP 1.5 problems on a Sun 4

#251
From: Karl Kleinpaste
Date: Tue, 25 Jul 1989 20:09
82 lines
2972 bytes
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);
Technical Details
Message-ID: <KARL.89Jul25160956@triceratops.cis.ohio-state.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!triceratops.cis.ohio-state.edu!karl
References: <226@auto-trol.UUCP>

Show Full Headers
Complete Article Headers
Message-ID: <KARL.89Jul25160956@triceratops.cis.ohio-state.edu>
Subject: Re: NNTP 1.5 problems on a Sun 4
Date: Tue, 25 Jul 1989 20:09:56 +0000
From: karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste)
References: <226@auto-trol.UUCP>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!triceratops.cis.ohio-state.edu!karl
Newsgroups: news.software.nntp
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