[patch] interface routes

Alexander V. Chernikov melifaro at FreeBSD.org
Thu Mar 7 06:34:37 UTC 2013


Hello list!

There is a known long-lived issue with interface routes addition/deletion:

ifconfig iface inet 1.2.3.4/24 can fail if given prefix is already in 
kernel route table (for example, advertised by IGP like OSPF).

Interface route can be deleted via route(8) or any route socket user 
(sometimes this happens with popular opensource daemons like bird/quagga).

Problem is reported at least in kern/106722 and kern/155772.

This can be fixed the following way:
Immutable route flag (RTM_PINNED, added in 19995 with 'for future use' 
comment) is utilised to mark route 'immutable'.
rtrequest1_fib refuses to delete routes with given flag unless 
RTM_PINNED is set in rti_flags.

Every interface address manupulation is done via rtinit[1], so
rtinit1() sets this flag (and behavior does not change here).

Adding interface address is handled via atomically deleting old prefix 
and adding interface one.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iface_routes.diff
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20130307/d7a4f2c6/attachment.ksh>


More information about the freebsd-net mailing list