Fix nexthop lookup for connected routes.
authorclaudio <claudio@openbsd.org>
Fri, 19 Aug 2022 09:11:18 +0000 (09:11 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 19 Aug 2022 09:11:18 +0000 (09:11 +0000)
commitfe164aedade678211ae088a10f04bb29f1b734d0
treef0218956ed4d82fc13de7316e3e3ac50a5e19d3f
parentc770c5a23ae92b3b4de79c9c7b87716f7881c07b
Fix nexthop lookup for connected routes.

In knexthop_true_nexthop() connected routes need to be handled specially.
If a nexthop is directly reachable the gateway needs to remain the same.
There is no nexthop set for F_CONNECTED kroutes. A very similar trick
is used in rde_rib.c::nexthop_update() but was forgotten here.

Regression noticed by Daniel Jakots (danj at chown.me).
OK tb@
usr.sbin/bgpd/kroute.c