On Thu, Jun 09, 2022 at 09:47:31AM +0100, Stuart Henderson wrote: > On 2022/06/08 22:47, Claudio Jeker wrote: > > and here is the updated diff I forgot to include > > Not sure if it's expected / not, but I lose interface information > with this: > > > $ diff -wu old new > --- old Thu Jun 9 09:44:37 2022 > +++ new Thu Jun 9 09:44:44 2022 > @@ -2,18 +2,19 @@ > Flags: * = nexthop valid > > Nexthop Route Prio Gateway Iface > > -* yyyyyyyyyy.2 yyyyyyyyyy.2/32 1 yyyyyyyyyy.2 lo1 (UP, unknown) > -* yyyyyyyyyy.3 yyyyyyyyyy.3/32 32 yyyyyyyyyy.69 ixl3 (UP, 1000 > Mbps) > -* yyyyyyyyyy.4 yyyyyyyyyy.4/32 32 yyyyyyyyyy.69 ixl3 (UP, 1000 > Mbps) > -* yyyyyyyyyy.7 yyyyyyyyyy.7/32 32 yyyyyyyyyy.69 ixl3 (UP, 1000 > Mbps) > -* yyyyyyyyyy.13 yyyyyyyyyy.13/32 32 yyyyyyyyyy.69 ixl3 (UP, 1000 > Mbps) > +* yyyyyyyyyy.2 yyyyyyyyyy.2/32 1 connected lo1 (UP, unknown) > +* yyyyyyyyyy.3 yyyyyyyyyy.3/32 32 yyyyyyyyyy.69 > +* yyyyyyyyyy.4 yyyyyyyyyy.4/32 32 yyyyyyyyyy.69 > +* yyyyyyyyyy.7 yyyyyyyyyy.7/32 32 yyyyyyyyyy.69 > +* yyyyyyyyyy.13 yyyyyyyyyy.13/32 32 yyyyyyyyyy.69 > * yyyyyyyyyy.179 yyyyyyyyyy.176/28 4 connected vlan701 (UP, > active) > * yyyyyyyyyy.180 yyyyyyyyyy.176/28 4 connected vlan701 (UP, > active) > * yyyyyyyyyy.183 yyyyyyyyyy.176/28 4 connected vlan701 (UP, > active) >
So those are all indirect routes learned via OSPF. Right now the code does not set the interface index for those. tb@ and I had a discussion about this and I'm not sure how this should behave. What I know is that the current bgpd kroute code only sets the ifindex in fetchtable for these routes but does not update them later on. So you get funky results over runtime when a gateway moves. At least dispatch_rtmsg_addr() does not set the ifindex for gateway routes while fetchtable() does. I need to think more about this. I adjusted my code to always track the ifindex but maybe that is not the right move. Need to think about this a bit more. -- :wq Claudio
