Hello Florian, On 23/12/14(Tue) 11:17, Florian Riehm wrote: > Hi Martin, > > as requested in your commit message I would like to tell you about a > regression > with the introduced local routes: > > Before OpenBSD 5.6 it was possible to add route labels to interfaces and tell > ospfd to redistribute all labeled routes. After adding an address to a labeled > interface a new route was announced via ospf. > > Now the ospfd can't detect added or deleted addresses anymore, because the > kernel informs about local routes instead of cloning routes.
Thanks for your attention and the report! > route -nv monitor: > > OPENBSD_5_5: > RTM_NEWADDR: address being added to iface: len 96, metric 0, flags:<CLONING> > sockaddrs: <NETMASK,IFP,IFA,BRD> > 255.255.255.0 08:00:27:ad:dd:7c 5.5.5.5 5.5.5.255 > > RTM_ADD: Add Route: len 192, priority 4, table 0, pid: 0, seq 0, errno 0 > flags:<UP,CLONING> > use: 0 mtu: 0 expire: 0 > locks: inits: > sockaddrs: <DST,GATEWAY,NETMASK,LABEL> > 5.5.5.0 link#3 255.255.255.0 EXPORT > > OPENBSD_5_6: > RTM_NEWADDR: address being added to iface: len 96, metric 0, flags:<UP> > sockaddrs: <NETMASK,IFP,IFA,BRD> > 255.255.255.0 08:00:27:fd:b8:81 5.5.5.5 5.5.5.255 > > RTM_ADD: Add Route: len 184, priority 1, table 0, pid: 0, seq 0, errno 0 > flags:<UP,HOST,LLINFO,LOCAL> > use: 0 mtu: 0 expire: 0 > locks: inits: > sockaddrs: <DST,GATEWAY,LABEL> > 5.5.5.5 08:00:27:fd:b8:81 EXPORT > > In the commit message of route.c r1.172 you said "always generating one > message > per locally configured address". > Are any userland tools needing this message? At least dhclient(8). > Would it make sense to remove the loop in rt_newaddrmsg which generates the > two > route messages? Instead of this rt_newaddrmsg sends only the RTM_NEWADDR / > RTM_DELADDR message and the other message gets send after creating/deleting > the > cloning route. I think it does make sense. It would restore the RTM_ADD for RTF_CLONING routes and keep one RTM_NEWADDR for RTF_LOCAL routes. Apart from your scenario with ospfd/ospf6d, dhclient should be happy with this change and I can think of a third case. If you configure two addresses of the same subnet you should see 2 RTM_NEWADDR but only one RTM_ADD since only the first address will get a cloning route. > By the way if rt_newaddrmsg() sends RTM_NEWADDR and RTM_DELADDR we should > rename it to rt_addrmsg(). If you remove the loop and generate only one message, I think that you can simply use rt_sendmsg() and kill rt_newaddrmsg().