Treat as next-hop invalid if import check is enabled.
Fixes: 654a5978f695087af062bfc9a382321fa2ccc4ae ("bgpd: prevent routes loop through itself")
Fixes: https://github.com/FRRouting/frr/issues/16877
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
&p.u.prefix6))
ifindex = pi->peer->connection->su.sin6.sin6_scope_id;
- if (!is_bgp_static_route && orig_prefix
- && prefix_same(&p, orig_prefix)) {
+ if (!is_bgp_static_route && orig_prefix && prefix_same(&p, orig_prefix) &&
+ CHECK_FLAG(bgp_route->flags, BGP_FLAG_IMPORT_CHECK)) {
if (BGP_DEBUG(nht, NHT)) {
- zlog_debug(
- "%s(%pFX): prefix loops through itself",
- __func__, &p);
+ zlog_debug("%s(%pFX): prefix loops through itself (import-check enabled)",
+ __func__, &p);
}
return 0;
}