Fix link-local nexthop calculation for P2P networks
The information used to lookup the link LSA of a router depends on the
rtr_link type. For transit networks the nbr_rtr_id and nbr_iface_id are
set to the DR rtr_id and iface_id. In that case the adv_rtr and iface_id
of that router need to be used for the lookup. For p2p and virtual links
the nbr_rtr_id and nbr_iface_id need to be used instead.
This fixes a case where wrong nexthops were selected for p2p links.
Also fix rt_nexthop_add and compare not only the nexthop address but also
the interface index aka scope since all nexthops are link-local and IPv6
is such a beautiful creature that needs scopes.
Based on a report and diff tested by Kapetanakis Giannis (bilias at edu.physics.uoc.gr)
Correctly handle VPN import into the FIB
If a VPN route was imported into the FIB and a later update changes the
import to exclude that route the route is not correctly withdrawn from the
FIB. The problem is that only the new prefix is checked for import and
simply skipped the insertion if it is not selected for import.
Add the missing check which deletes a possible old entry if it was imported
before.
Reported by N0zoM1z0 PR#181
OK tb@
Make rde_reflector check for ebgp peers before accepting the attributes.
Route-reflectors should only use the ORIGINATOR_ID and CLUSTER_LIST
attributes if sent from an internal peer. For ebgp sessions these
attributes need to be ignored. This is already done in rde_attr_parse()
but until recently the check for ORIGINATOR_ID was missing there.
This is the code implementing most of the route-reflector logic and
it is the right place to ensure ebgp peers are correctly handled.
OK tb@