]> git.puffer.fish Git - mirror/frr.git/commit
zebra: fix FIB route updates on *BSD
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 16 Dec 2016 12:48:37 +0000 (10:48 -0200)
committerMartin Winter <mwinter@opensourcerouting.org>
Fri, 23 Dec 2016 06:27:03 +0000 (13:27 +0700)
commit949ae9ba1531be3629da0b5be47ff4dae763baa0
treef410cc4a2742b380b442f7d69c7fc1285f8b5a4a
parent2504fdc95d0f4a22ed54786d063fd426c4a2d1ec
zebra: fix FIB route updates on *BSD

On *BSD, we update a route in the FIB by removing the old one and then
installing the new version.

With that said, on kernel_route_rib() we need to provide a pointer to
both the old version and the new version of the route.

We were, however, passing a pointer to the new version to both the
'old' and 'new' parameters. This is not a problem on Linux, which uses
NLM_F_REPLACE to update routes, but it breaks route updates on *BSD
because the 'old' parameter points to a route that is not installed in
the kernel. The kernel_route_rib() function then fails to uninstall the
supposedly 'old' route and can fail to install the new version as well if
the kernel doesn't support ECMP (e.g. FreeBSD with default configuration).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/rib.h
zebra/zebra_rib.c
zebra/zebra_static.c