Route update question
santiago at crfreenet.org
Sat Oct 31 18:44:13 CET 2015
On Fri, Oct 30, 2015 at 06:40:49PM -0400, Jigar Mehta wrote:
> I am using my own protocol and wanted to understand more about handling of
> route update. When my protocol receives a route, I inform the core using
> rte_update() and pass on the new route and when I need to delete I set new
> = NULL and call rte_update().
> Problem :
> 1. This is the initial route that was installed in the table.
> Route1 10.0.1.0/24 Metric : 10
> 2. Received a better route with Metric as 5, so i call rte_update and pass
> on the new route. So now, I have
> Route1 10.0.1.0/24 Metric: 5
> 3. Protocol again receives an update to delete the cost 5 route (step 2) .
> However when I do that, I see that I no longer have any route to 10.0.1.0/24
> instead of having a higher cost route (cost 10 ).
This is expected behavior, rte_update() replaces the current route for a
network with a new one. The key is only the network, not the metric.
If you want to propagate multiple routes for the same network from one
protocol to one table, you can use rte_update2() and rt_get_source(). In
that case, rte_update2() will replace the route from the same source. You
can use metric as ID for rt_get_source(), so the routing table will keep
one route per network+metric from your protocol.
Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: Digital signature
More information about the Bird-users