Subject: Re: in_addprefix() not handling RTF_HOST (pointtopoint) correctly.
To: None <itojun@iijlab.net>
From: Sean Boudreau <seanb@qnx.com>
List: tech-net
Date: 06/06/2003 09:00:47
On Fri, Jun 06, 2003 at 07:21:48PM +0900, itojun@iijlab.net wrote:
> ># ifconfig ex0
> >ex0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >	capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
> >	enabled=0<>
> >	address: 00:04:75:dc:7e:68
> >	media: Ethernet autoselect (100baseTX full-duplex)
> >	status: active
> >	inet 10.7.0.131 netmask 0xff000000 broadcast 10.255.255.255
> >	inet6 fe80::204:75ff:fedc:7e68%ex0 prefixlen 64 scopeid 0x2
> ># ifconfig gif0
> >gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
> ># netstat -rnfinet
> >Routing tables
> >
> >Internet:
> >Destination        Gateway            Flags     Refs     Use    Mtu  Interface
> >10                 link#2             UC          0        0      -  ex0
> >127                127.0.0.1          UGRS        0        0  33220  lo0
> >127.0.0.1          127.0.0.1          UH          1        2  33220  lo0
> ># ifconfig gif0 10.0.0.1 10.0.0.2
> ># netstat -rnfinet
> >Routing tables
> >
> >Internet:
> >Destination        Gateway            Flags     Refs     Use    Mtu  Interface
> >10                 link#2             UC          0        0      -  ex0
> >127                127.0.0.1          UGRS        0        0  33220  lo0
> >127.0.0.1          127.0.0.1          UH          1        2  33220  lo0
> ># route add -host -iface 10.0.0.2 10.0.0.1
> >add host 10.0.0.2: gateway 10.0.0.1
> >
> >^^^^^^^^^^^^^^^^^
> >This last step appears to be a regression from 1.5 as on that version
> >the route is added automatically by the kernel.
> 
> 	the host route gets installed ok for me on -current.  i guess this is
> 	due to the fact you have 10.0.0.0/8 assigned to your ex0 interface
> 	already.  try another number (like 20.0.0.1 20.0.0.2) on gif0 and
> 	see what happens.

Yes, I chose addresses on the same subnet to show the behaviour.
in_addprefix() is always masking against the netmask, even for RTF_HOST.
This doesn't seem right.  Please see the previous diff.

-seanb