🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Ask Bj�rn Hansen Sun, 12 Oct 1997 00:00
make inn bind only to a few ip numbers on linux..
#22290
Author: Ask Bj�rn Hansen
Date: Sun, 12 Oct 1997 00:00
22 lines
1210 bytes
Hi,

Im using INN 1.5.1 on a RedHat Linux 4.2 box..

I have some virtual interfaces which INN not should know about.  
It's now possible to connect to the nntp port of f.x. 194.192.97.35
(eth0:35), which it should not be.

How can I change this?


kind regards,

ask

---------------------------------------------------------------------
ask bjoern hansen - Netcetera - Finsensvej 80 - DK-2000 Frederiksberg
tlf 38 88 32 22 / 40 44 58 66 / 38 88 20 38 ext 341 - Fax 38 88 30 38
Webdesign, Webhotel, Mailhotel, UUCP & more! http://www.netcetera.dk/

Re: make inn bind only to a few ip numbers on linux..
#22314
Author: Forrest J. Cavalier III
Date: Mon, 13 Oct 1997 00:00
31 lines
1587 bytes
In article <ask-1210972337120001@balder.netcetera.dk>, ask@netcetera.dk 
wrote...
>
>Hi,
>
>Im using INN 1.5.1 on a RedHat Linux 4.2 box..
>
>I have some virtual interfaces which INN not should know about.  
>It's now possible to connect to the nntp port of f.x. 194.192.97.35
>(eth0:35), which it should not be.
>
>How can I change this?

Joe Greco has a patch which forces innd to bind to a specific
address.  The application he mentions in the description is
a bit different, but it should work for you.

That and other patches are listed at:  "INN patches by topic: INND"
    http://www.mibsoftware.com/userkt/inn/patches/0011.htm

You'll probably have to know a bit about C to get it to work
correctly.  But the idea will be sound....

Forrest Cavalier, Mib Software, INN customization and consulting 
Searchable hypertext INN docs, FAQ, RFCs, etc: 650+ pages: 
    http://www.mibsoftware.com/userkt/forprov.htm 
Commercial support for INN: http://www.mibsoftware.com/innsup.htm 


Re: make inn bind only to a few ip numbers on linux..
#22389
Author: Rahul Dhesi
Date: Tue, 14 Oct 1997 00:00
39 lines
2038 bytes
Bjxrn Hansen) writes:

>I have some virtual interfaces which INN not should know about.  
>It's now possible to connect to the nntp port of f.x. 194.192.97.35
>(eth0:35), which it should not be.

>How can I change this?

Below is what I added to inndstart.c, just before the bind() system
call.  It gets the desired host name from the INNHOST environment
variable.  Apply manually.

+    {
+#include <netdb.h>
+       struct hostent *hostent;
+       extern struct hostent *gethostbyname();
+       char *buf = getenv("INNHOST");
+       if (buf != NULL) {
+           server.sin_addr.s_addr = inet_addr(buf);
+           if (server.sin_addr.s_addr == (long) -1) {  /* not dotted quad */
+               hostent = gethostbyname(buf);
+               if (hostent == NULL) {
+                   /* unresolved host name */
+                   syslog(L_ERROR, "inndstart cant bind to unknown host %s",
+                                                                       buf);
+                   server.sin_addr.s_addr = htonl(INADDR_ANY);
+               } else {
+                   server.sin_family = hostent->h_addrtype;
+                   bcopy(hostent->h_addr,
+                       (caddr_t)&server.sin_addr, hostent->h_length);
+               }
+           }
+       }
+    }
-- 
Rahul Dhesi <dhesi@spams.r.us.com>

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads