🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #79029

Another bug - was Re: Possible Innfeed bug - Destination has unspecified address.

#79029
From: D. Stussy
Date: Tue, 13 May 2008 00:52
67 lines
3772 bytes
"D. Stussy" <spam@bde-arc.ampr.org> wrote in message
news:fvt1bf$qug$1@snarked.org...
> One of my peers has had a change in its DNS address record and is now
> publishing "0.0.0.0" (the unspecified address) as its address.  ...

In looking at this further and while debugging a local patch to avoid the
above problem, I noticed something else strange.  First, a simple patch:

diff -ur inn-STABLE-20080229/innfeed/host.c inn-Modified/innfeed/host.c
--- inn-STABLE-20080229/innfeed/host.c  2008-02-29 10:08:19.000000000 +0000
+++ inn-Modified/innfeed/host.c 2008-05-12 20:24:25.000000000 +0000
@@ -3298,6 +3322,20 @@

   fputc ('\n',fp) ;

+  if (host->ipAddrs) {
+      int i;
+      char *family;
+
+      for(i=0; host->ipAddrs[i] != NULL; ++i) {
+       switch(host->ipAddrs[i]->sa_family) {
+         case AF_INET:   family="IPv4"; break;
+         case AF_INET6:  family="IPv6"; break;
+         default:        family="????"; break;
+       }
+       fprintf(fp,"IP Addr %-2u: %-4.4s  %s\n", i+1, family,
sprint_sockaddr(host->ipAddrs[i]));
+      }
+  }
+
   fprintf (fp, "   seconds: %-7ld   art. timeout: %-5d        ip name:
%s\n",
           host->firstConnectTime > 0 ? (long)(now - host->firstConnectTime)
: 0,
           host->params->articleTimeout, host->params->ipName) ;
--- End of patch

As one might guess, this patch causes innfeed to print the IP addresses
(IPv4 and IPv6) that it has internally stored for a peer.  It prints one
line as expected for the stable version released 02/29/2008 (the version I
had on hand), but when I apply it to today's version (Stable 05/12/2008), I
was rather surprised:  Each address seems to be duplicated in the "ipAddrs"
array 3 times.  That is just strange.  This is the only patch applied to
today's version - a fresh copy.

Why is each IP address stored 3 times in the array?  Where multiple
addresses exist, all copies of the same address were consecutive.

Example:
------------------------------------------------------------------
feeder.erje.net
   Addr 1 : IPv6  2001:470:992a::1
   Addr 2 : IPv6  2001:470:992a::1
   Addr 3 : IPv6  2001:470:992a::1
   Addr 4 : IPv4  88.198.5.53
   Addr 5 : IPv4  88.198.5.53
   Addr 6 : IPv4  88.198.5.53
   seconds: 746       art. timeout: 600          ip name:
snarked-in.feeder.erje.net
...
------------------------------------------------------------------
With the "i" index incrementing, it's not some stupid error inside the loop.

PS:  What's with all the "%d"'s for values which are obviously UNSIGNED or
non-negative only.  Why not "%u" for those values?

Technical Details
Message-ID: <g0aoo6$op9$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!news.linkpendium.com!news.linkpendium.com!news.snarked.org!not-for-mail
References: <fvt1bf$qug$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <g0aoo6$op9$1@snarked.org>
Subject: Another bug - was Re: Possible Innfeed bug - Destination has unspecified address.
Date: Mon, 12 May 2008 17:52:25 -0700
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <fvt1bf$qug$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!news.linkpendium.com!news.linkpendium.com!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 67
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-118-49-180.lsanca.dsl-w.verizon.net
X-Trace: snarked.org 1210639942 25385 71.118.49.180 (13 May 2008 00:52:22 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Tue, 13 May 2008 00:52:22 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478