Re: [PATCH] netstat(1) should print CIDR prefixes

2007-02-12 Thread Bruce M Simpson

Gary Corcoran wrote:


Since those 'classes' haven't meant anything for many years, and 
interpreting
them as 'special' is just plain wrong in almost all cases these days, 
I think

the change is the right thing to do.

I've had +3.

Any objections? If I hear none I will make this change in -CURRENT; with 
a note in UPDATING.


Regards,
BMS
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


[PATCH] netstat(1) should print CIDR prefixes

2007-02-10 Thread Bruce M Simpson

Hi,

This is a POLA violating 'let's move with the times' patch that gets rid 
of the special treatment of classful IPv4 network prefixes in 'netstat 
-rn' output. Comments please!


Rgards,
BMS
Index: route.c
===
RCS file: /home/ncvs/src/usr.bin/netstat/route.c,v
retrieving revision 1.76
diff -u -p -r1.76 route.c
--- route.c	13 May 2005 16:31:10 -	1.76
+++ route.c	10 Feb 2007 22:55:50 -
@@ -865,32 +865,7 @@ netname(u_long in, u_long mask)
 		strncpy(line, cp, sizeof(line) - 1);
 		line[sizeof(line) - 1] = '\0';
 	} else {
-		switch (dmask) {
-		case IN_CLASSA_NET:
-			if ((i  IN_CLASSA_HOST) == 0) {
-sprintf(line, %lu, C(i  24));
-break;
-			}
-			/* FALLTHROUGH */
-		case IN_CLASSB_NET:
-			if ((i  IN_CLASSB_HOST) == 0) {
-sprintf(line, %lu.%lu,
-	C(i  24), C(i  16));
-break;
-			}
-			/* FALLTHROUGH */
-		case IN_CLASSC_NET:
-			if ((i  IN_CLASSC_HOST) == 0) {
-sprintf(line, %lu.%lu.%lu,
-	C(i  24), C(i  16), C(i  8));
-break;
-			}
-			/* FALLTHROUGH */
-		default:
-			sprintf(line, %lu.%lu.%lu.%lu,
-C(i  24), C(i  16), C(i  8), C(i));
-			break;
-		}
+		inet_ntop(AF_INET, (char *)in, line, sizeof(line) - 1);
 	}
 	domask(line + strlen(line), i, mask);
 	return (line);
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]

Re: [PATCH] netstat(1) should print CIDR prefixes

2007-02-10 Thread Matthew D. Fuller
On Sat, Feb 10, 2007 at 10:57:13PM + I heard the voice of
Bruce M Simpson, and lo! it spake thus:
 
 This is a POLA violating 'let's move with the times' patch that gets
 rid of the special treatment of classful IPv4 network prefixes in
 'netstat -rn' output. Comments please!

Please!

1.2.3/24 is *wrong* when you're referring to 1.2.3.0/24 and not
1.2.0.3/24.  Talking netstat out of giving me that wrong information
is a Good Thing(tm).


-- 
Matthew Fuller (MF4839)   |  [EMAIL PROTECTED]
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [PATCH] netstat(1) should print CIDR prefixes

2007-02-10 Thread Gary Corcoran

Bruce M Simpson wrote:

Hi,

This is a POLA violating 'let's move with the times' patch that gets rid 
of the special treatment of classful IPv4 network prefixes in 'netstat 
-rn' output. Comments please!


Since those 'classes' haven't meant anything for many years, and interpreting
them as 'special' is just plain wrong in almost all cases these days, I think
the change is the right thing to do.

Just my $0.02 worth...

Gary
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]