🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #113

nntpd on Sun4 running SunOS 4.0.1 drops core in getifconf()

#113
From: Karl Kleinpaste
Date: Thu, 16 Feb 1989 21:22
83 lines
3088 bytes
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);
Technical Details
Message-ID: <KARL.89Feb16162217@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

Show Full Headers
Complete Article Headers
Message-ID: <KARL.89Feb16162217@triceratops.cis.ohio-state.edu>
Subject: nntpd on Sun4 running SunOS 4.0.1 drops core in getifconf()
Date: Thu, 16 Feb 1989 21:22:17 +0000
From: karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste)
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
Organization: OSU
Lines: 82