]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: allow for vpn->vrf imports
authorLou Berger <lberger@labn.net>
Tue, 10 Oct 2017 14:00:10 +0000 (10:00 -0400)
committerLou Berger <lberger@labn.net>
Tue, 31 Oct 2017 15:06:17 +0000 (11:06 -0400)
      ignore nexthop checks for RFAPI imported routes (as is self)
      note: NHT is still updated

Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_route.c
bgpd/bgpd.h

index 62305609970974ea336e954344bc521875b24523..2753295f472c07569177c9494e3f7ad1567ab3f5 100644 (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)) {
index 9c38a65b40023e91e73cbf3db3e666cf7b5701e0..2fd1116c3ccaddf95da97713f63dad216190c896 100644 (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;