cvs commit: src/sys/net route.h rtsock.c

Andre Oppermann andre at
Wed Mar 15 21:15:08 UTC 2006

Gleb Smirnoff wrote:
>   Andre,
> On Wed, Mar 15, 2006 at 07:39:09PM +0000, Andre Oppermann wrote:
> A>   - The unused rtm_use field in struct rt_msghdr is redesignated as
> A>     rtm_fmask field to communicate route flag changes in RTM_CHANGE
> A>     messages from userland.  The use count of a route was moved to
> A>     rtm_rmx a long time ago.  For source code compatibility reasons
> A>     a define of rtm_use to rtm_fmask is provided.
> Be careful. rtm_use isn't unused - it is used sysctl_dumpentry()
> to return the usage of route to userland. However, I don't see
> programs netstat(1) and route(1) to read it. Anyway, I think
> it deserves a comment.

It does copy it but it also copies struct rt_rmx.  Probably rtm_use
should be defined to alias to rt_rmx.rmx_pksent to get this right.

> A>   These changes faciliate running of multiple cooperating routing
> A>   daemons at the same time without causing undesired interference.
> A>   Open[BGP|OSPF]D make use of these features to have IGP routes
> A>   override EGP ones.
> Please explain how is this done. Does radix allow presence of two
> identical prefixes in tree, and we distinguish them by rt->rt_flags?

No.  If you've got the same prefix in BGP and OSPF with different next
hops then the OSPF one should win.  Normally the two daemons would get
into a fight about this and indefinatly try to replace each others
route again.  This change makes it possible for two cooperating daemons
to avoid this.  With the change to flags OSPFD may take over an existing
route by chaning the PROTO flag to itself.  BGPD then knows it got an
override.  Before OSPFD had to delete the route and re-add it with its
own parameters.  However upon the delete message BGPD would try to add
it again.  When OSPFD removes a route that was identical to a BGP one
BGPD will re-add its own version of it.


More information about the cvs-src mailing list