Thread View: news.software.nntp
2 messages
2 total messages
Started by Rob Monz
Sat, 06 Dec 1997 00:00
inn cidr slash patch
Author: Rob Monz
Date: Sat, 06 Dec 1997 00:00
Date: Sat, 06 Dec 1997 00:00
7 lines
566 bytes
566 bytes
Where can I get the inn cidr slash patch ? Thanks rob
Re: inn cidr slash patch
Author: Dale Ghent
Date: Sat, 06 Dec 1997 00:00
Date: Sat, 06 Dec 1997 00:00
125 lines
4551 bytes
4551 bytes
This is a multi-part message in MIME format.
--------------FF6ABD31DF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Rob Monz wrote:
>
> Where can I get the inn cidr slash patch ? Thanks
Here it is
-Dale G.
--
Dale Ghent daleg @ digex.net
NetworkNews Administrator DIGEX, Inc.
http://www.digex.net Beltsville, MD
I speak for myself
--------------FF6ABD31DF
Content-Type: text/plain; charset=us-ascii; name="nnrpd-cidr.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="nnrpd-cidr.patch"
The following patch will allow you to do a netmask in your nnrp.access
file so that you can offer news access to pieces of what are commonly
known as subnetted class Cs. For example, you can currently do this:
165.154.*:RP:::*,!clari*
...or this:
165.154.1.*:RP:::*,!clari*
...but you can't get any more specific than that with wildcards in any
reasonable fashion. If you split this network at a bit boundary beyond
24 bits, you start to require multiple lines to do the trick. With
this patch, you can do this:
165.154.1.0/255.255.255.224:RP:::*,!clari*
...or this:
165.154.1.0/27:RP:::*,!clari*
It's worked for me so far. Let me know if you have any problems with it.
*** nnrpd.c 1996/11/19 19:59:00 1.2
--- nnrpd.c 1996/12/11 01:03:29
***************
*** 347,357 ****
/* Malformed line. */
continue;
! if (hp)
/* Got an address; try to match either the IP address or as
* a text hostname. */
if (!(ip && wildmat(ip, fields[0])) && !wildmat(hp, fields[0]))
continue;
/* See if we should lookup a specific user in the passwd file */
if (user && pass && EQ(fields[2], "+")) {
--- 347,401 ----
/* Malformed line. */
continue;
! if (hp) {
/* Got an address; try to match either the IP address or as
* a text hostname. */
+ #if defined(HOOKUP)
+ int ipmatch = FALSE;
+ int hostmatch = FALSE;
+ int netmatch = FALSE;
+
+ /* compare IP number and first field */
+ if (ip && wildmat(ip, fields[0]))
+ ipmatch = TRUE;
+
+ /* compare hostname and first field */
+ if (hp && wildmat(hp, fields[0]))
+ hostmatch = TRUE;
+
+ /* try a netmask match */
+ if (ip && (p = strchr(fields[0],'/')) != (char *)NULL) {
+ int bits;
+ int c;
+ struct in_addr ia;
+ unsigned int mask;
+ struct in_addr net;
+ char *q;
+
+ *p = '\0';
+ mask = inet_addr(p+1);
+ if (mask == (unsigned int)INADDR_NONE) {
+ bits = strtoul(p+1,&q,10);
+ for (c = 0; c <= bits; c++)
+ mask |= (1 << (32-c));
+ mask = htonl(mask);
+ }
+ ia.s_addr = inet_addr(ip);
+ net.s_addr = inet_addr(fields[0]);
+ if (ia.s_addr != (unsigned int)INADDR_NONE &&
+ net.s_addr != (unsigned int)INADDR_NONE &&
+ bits > 0 &&
+ *q == '\0' &&
+ (ia.s_addr & mask) == (net.s_addr & mask))
+ netmatch = TRUE;
+ }
+ if (!ipmatch && !hostmatch && !netmatch)
+ continue;
+ #else
if (!(ip && wildmat(ip, fields[0])) && !wildmat(hp, fields[0]))
continue;
+ #endif
+ }
/* See if we should lookup a specific user in the passwd file */
if (user && pass && EQ(fields[2], "+")) {
--------------FF6ABD31DF--
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