Subject: Re: Wierd route on NetBSD 2.1
To: None <netbsd-users@NetBSD.org>
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
List: netbsd-users
Date: 01/23/2006 17:59:44
On Mon, Jan 23, 2006 at 11:25:34AM -0500, matthew sporleder wrote:
>  0.0.5&0xa050501 isn't a valid ip.  From the part of the message you
> cut off, you can see there's a negative value for the netmask set. (I
> believe it was -7)  This should not be allowed, and it seems to be
> causing some sort of (casting?) error where the last octect of the ip
> is a larger-than-255 hex value.
> 
> In what way is this legal?

That's *not* the netmask. That's the attempt of "route" to translate
the netmask into a number of contiguous bits being 1, which, of course,
fails.

Maybe I'm confused, but I don't see how the cited route and netstat
output points to a NetBSD problem, unless the original poster tells us
what entered that route into the kernel. I can do it, for example, with
a simple shell commad:

# route add 192.168.0.0 -netmask 10.5.5.1 255.255.0.255
add net 192.168.0.0: gateway 255.255.0.255
# netstat -rnf inet
Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use    Mtu  Interface
0&0xa050501        255.255.0.255      UGS         0        0      -  ex0 =>

Regards
	Ignatios