Article View: news.software.nntp
Article #79515A pair of small patches I'd like to see in the mainstream.
From: D. Stussy
Date: Fri, 17 Oct 2008 22:16
Date: Fri, 17 Oct 2008 22:16
76 lines
3586 bytes
3586 bytes
Re: Possible Innfeed bug - Destination has unspecified address.
This was the patch where I found the above problem (since corrected). I'd
still like to see it make it into INN in some form.
What it does: (2 parts)
- Inn: For Inn_status, it allows printing of MULTIPLE IP addresses of a
connected peer (space in buffer permitting). It makes one assumption: That
no IP address will be a substring of any other IP address of the same news
peering host. The address string buffer is (currently) 64 characters, but
IPv4 addresses are only 15 characters long maximum and IPv6 are 39. I have
found that sometimes peers connect using both (multiple connections of
course).
- Innfeed: A similar patch, showing all addresses that Innfeed thinks the
peer has. I listed this before in the bug thread.
Feel free to implement this conditionally (i.e. add some configuration
parameter to control the behavior).
Part 1:
diff -ur innd/status.c innd/status.c
--- innd/status.c 2008-05-05 10:18:36.000000000 +0000
+++ innd/status.c 2008-05-15 01:49:39.000000000 +0000
@@ -177,6 +177,15 @@
else
tmp->next = status;
tmp = status;
+ } else {
+ char *p;
+
+ p = sprint_sockaddr((struct sockaddr *)&cp->Address);
+ if ((strstr(status->ip_addr, p) == NULL) &&
+ (strlen(status->ip_addr) + strlen(p) + 1 <
sizeof(status->ip_addr))) {
+ strcat(status->ip_addr, " ");
+ strcat(status->ip_addr, p);
+ }
}
if (Now.time - cp->Started > status->seconds)
status->seconds = Now.time - cp->Started;
Part 2:
diff -ur innfeed/host.c innfeed/host.c
--- innfeed/host.c 2008-05-05 10:18:36.000000000 +0000
+++ innfeed/host.c 2008-05-14 21:50:38.000000000 +0000
@@ -3477,6 +3478,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,"Address %-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) ;
Comments?
Technical Details
Message-ID:
<gdb2rs$7av$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!border1.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeeder20.multikabel.net!newsfeed.freenet.de!news.k-dsl.de!news.snarked.org!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <gdb2rs$7av$1@snarked.org> Subject: A pair of small patches I'd like to see in the mainstream. Date: Fri, 17 Oct 2008 15:16:26 -0700 From: "D. Stussy" <spam@bde-arc.ampr.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!border1.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeeder20.multikabel.net!newsfeed.freenet.de!news.k-dsl.de!news.snarked.org!not-for-mail Newsgroups: news.software.nntp Lines: 76 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> NNTP-Posting-Host: pool-71-118-52-187.lsanca.dsl-w.verizon.net X-Trace: snarked.org 1224281788 7519 71.118.52.187 (17 Oct 2008 22:16:28 GMT) X-Complaints-To: newsmaster@snarked.org NNTP-Posting-Date: Fri, 17 Oct 2008 22:16:28 +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