kernel - Deal with inconsistencies between IP aliases and primary IPs
These changes allow normal IP aliases with proper network masks to be
ifconfig'd instead of forcing people to use non-obvious /32's for their
IP aliases. It may also be possible to use overlapping subnets with
this change but this is not tested.
* When ifconfig'ing an interface with aliases using the correct netmask
instead of a /32, the network route will point to only one of the
addresses.
Trying to connect to a local IP alias wound up failing due to the
mismatch between the network route's interface address (ifaddr)
entry and the actual ifaddr being requested. The target was not
being considered a local address when it was.
* Fix in_addroute()'s detection of local host routes when cloning a
route to check against all aliases instead of the one the gateway
network route happens to be pointed to, and adjust the route entry
appropriately.
This fix also properly sets RTF_LOCAL for all such cloned routes
whereas before RTF_LOCAL was only being set for the interface's
primary IP.
* Minor syntax adjustments and documentation changes.
Reported-by: Peter Avalos <peter@theshell.com>