bgpd: allow for vpn->vrf imports

ignore nexthop checks for RFAPI imported routes (as is self)
      note: NHT is still updated

Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
Lou Berger 2017-10-10 10:00:10 -04:00
parent d477c01df7
commit 02a82b47b3
2 changed files with 7 additions and 5 deletions

View File

@ -2788,7 +2788,8 @@ int bgp_update(struct peer *peer, struct prefix *p, u_int32_t addpath_id,
}
/* next hop check. */
if (bgp_update_martian_nexthop(bgp, afi, safi, &new_attr)) {
if (!CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD) && /* allow vpn->vrf import */
bgp_update_martian_nexthop(bgp, afi, safi, &new_attr)) {
reason = "martian or self next-hop;";
bgp_attr_flush(&new_attr);
goto filtered;
@ -3031,7 +3032,8 @@ int bgp_update(struct peer *peer, struct prefix *p, u_int32_t addpath_id,
connected = 0;
if (bgp_find_or_add_nexthop(bgp, afi, ri, NULL,
connected))
connected) ||
CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
bgp_info_set_flag(rn, ri, BGP_INFO_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {
@ -3143,7 +3145,8 @@ int bgp_update(struct peer *peer, struct prefix *p, u_int32_t addpath_id,
else
connected = 0;
if (bgp_find_or_add_nexthop(bgp, afi, new, NULL, connected))
if (bgp_find_or_add_nexthop(bgp, afi, new, NULL, connected) ||
CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
bgp_info_set_flag(rn, new, BGP_INFO_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {

View File

@ -699,9 +699,8 @@ struct peer {
#define PEER_FLAG_DYNAMIC_NEIGHBOR (1 << 12) /* dynamic neighbor */
#define PEER_FLAG_CAPABILITY_ENHE (1 << 13) /* Extended next-hop (rfc 5549)*/
#define PEER_FLAG_IFPEER_V6ONLY (1 << 14) /* if-based peer is v6 only */
#if ENABLE_BGP_VNC
#define PEER_FLAG_IS_RFAPI_HD (1 << 15) /* attached to rfapi HD */
#endif
/* outgoing message sent in CEASE_ADMIN_SHUTDOWN notify */
char *tx_shutdown_message;