in.c autoadding prefix route

Max Laier max at love2party.net
Thu Nov 11 12:24:02 PST 2004


All,

I know I have sent this a couple of times before, but never got anywhere. This 
time I am set to commit!

The attached patch (http://people.freebsd.org/~mlaier/in.c.patch) derived from 
WIDE via OpenBSD in.c, rev 1.21 improves the handling of automatic prefix 
routes.

Right now you can't have two legs into the same network. If you want to, you 
must give on of the interfaces a host address only (netmask /32). This way it 
is not possible to hand over the route if one of the interfaces is 
"removed" (however this is done in the special case).

The patch allows to add more than on IPv4 address with the same prefix. In the 
case that there is a route already, we leave it alone and add the new address 
without the IFA_ROUTE flag. When we remove an address later on, that has a 
route associated, we try to find an alternative address to use for the route 
and hand it over.

This is required for CARP, but should be helpful for other situations as well.

Any objections?

I also plan to merge this back to RELENG_5 after some time. I don't see this 
breaking assumptions (it was an error case before) - please tell me if you 
see something.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: in.c.patch
Type: text/x-diff
Size: 6247 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20041111/ceb59b28/in.c.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20041111/ceb59b28/attachment.bin


More information about the freebsd-net mailing list