]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #1915 from vivek-cumulus/evpn-ipv6-external-routing
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 27 Mar 2018 15:32:06 +0000 (17:32 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Mar 2018 15:32:06 +0000 (17:32 +0200)
EVPN IPv6 external routing

bgpd/bgp_evpn.c
bgpd/bgp_evpn_vty.c
bgpd/bgp_route.c
bgpd/bgp_zebra.c

index 448cc91cc7d81c8ee5cc318fa334eef2093f6718..c1fc45f0707faa74aeceb657a22cc2e21427c4fb 100644 (file)
@@ -862,7 +862,7 @@ static int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
         */
        if (old_select && old_select == new_select
            && old_select->type == ZEBRA_ROUTE_BGP
-           && old_select->sub_type == BGP_ROUTE_NORMAL
+           && old_select->sub_type == BGP_ROUTE_IMPORTED
            && !CHECK_FLAG(rn->flags, BGP_NODE_USER_CLEAR)
            && !CHECK_FLAG(old_select->flags, BGP_INFO_ATTR_CHANGED)
            && !bgp->addpath_tx_used[afi][safi]) {
@@ -898,7 +898,7 @@ static int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
        }
 
        if (new_select && new_select->type == ZEBRA_ROUTE_BGP
-           && new_select->sub_type == BGP_ROUTE_NORMAL) {
+           && new_select->sub_type == BGP_ROUTE_IMPORTED) {
                flags = 0;
                if (new_select->attr->sticky)
                        SET_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY);
@@ -919,7 +919,7 @@ static int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
                        evpn_delete_old_local_route(bgp, vpn, rn, old_select);
        } else {
                if (old_select && old_select->type == ZEBRA_ROUTE_BGP
-                   && old_select->sub_type == BGP_ROUTE_NORMAL)
+                   && old_select->sub_type == BGP_ROUTE_IMPORTED)
                        ret = evpn_zebra_uninstall(bgp, vpn,
                                                   (struct prefix_evpn *)&rn->p,
                                                   old_select->attr->nexthop);
@@ -1139,7 +1139,7 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
                        local_ri = tmp_ri;
                if (vni_table) {
                        if (tmp_ri->type == ZEBRA_ROUTE_BGP
-                           && tmp_ri->sub_type == BGP_ROUTE_NORMAL
+                           && tmp_ri->sub_type == BGP_ROUTE_IMPORTED
                            && CHECK_FLAG(tmp_ri->flags, BGP_INFO_VALID)) {
                                if (!remote_ri)
                                        remote_ri = tmp_ri;
@@ -1840,7 +1840,7 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
                attr_new = bgp_attr_intern(&attr);
 
                /* Create new route with its attribute. */
-               ri = info_make(parent_ri->type, parent_ri->sub_type, 0,
+               ri = info_make(parent_ri->type, BGP_ROUTE_IMPORTED, 0,
                               parent_ri->peer, attr_new, rn);
                SET_FLAG(ri->flags, BGP_INFO_VALID);
                bgp_info_extra_get(ri);
@@ -1912,7 +1912,7 @@ static int install_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
                attr_new = bgp_attr_intern(parent_ri->attr);
 
                /* Create new route with its attribute. */
-               ri = info_make(parent_ri->type, parent_ri->sub_type, 0,
+               ri = info_make(parent_ri->type, BGP_ROUTE_IMPORTED, 0,
                               parent_ri->peer, attr_new, rn);
                SET_FLAG(ri->flags, BGP_INFO_VALID);
                bgp_info_extra_get(ri);
index 58487a682cebce4d6731803a2a6e658aca82b4ec..3d77199bfd69d995b86618ab9f541908e459268c 100644 (file)
@@ -2766,7 +2766,7 @@ DEFUN (bgp_evpn_advertise_type5,
                rmap_changed = 1;
        }
 
-       if (!(afi == AFI_IP) || (afi == AFI_IP6)) {
+       if (!(afi == AFI_IP || afi == AFI_IP6)) {
                vty_out(vty,
                        "%%only ipv4 or ipv6 address families are supported");
                return CMD_WARNING;
index 41dff0a7e2ce45b40a4a2ce0093a5af8c6553add..e0c54e0845665979936c08f5741a88a97b292ba0 100644 (file)
@@ -557,7 +557,8 @@ static int bgp_info_cmp(struct bgp *bgp, struct bgp_info *new,
         *  - BGP_ROUTE_AGGREGATE
         *  - BGP_ROUTE_REDISTRIBUTE
         */
-       if (!(new->sub_type == BGP_ROUTE_NORMAL)) {
+       if (!(new->sub_type == BGP_ROUTE_NORMAL ||
+             new->sub_type == BGP_ROUTE_IMPORTED)) {
                if (debug)
                        zlog_debug(
                                "%s: %s wins over %s due to preferred BGP_ROUTE type",
@@ -565,7 +566,8 @@ static int bgp_info_cmp(struct bgp *bgp, struct bgp_info *new,
                return 1;
        }
 
-       if (!(exist->sub_type == BGP_ROUTE_NORMAL)) {
+       if (!(exist->sub_type == BGP_ROUTE_NORMAL ||
+             new->sub_type == BGP_ROUTE_IMPORTED)) {
                if (debug)
                        zlog_debug(
                                "%s: %s loses to %s due to preferred BGP_ROUTE type",
index bc6ee73da8d5d7e4539b7b6eb7bb41b2bfd72a83..1e3b2a4f450b03afbe61bf1bb3f8f139a73be288 100644 (file)
@@ -1043,7 +1043,7 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
         * Currently presence of rmac in attr denotes
         * this is an EVPN type-2 route
         */
-       if (!is_zero_mac(&(info->attr->rmac)))
+       if (info->sub_type == BGP_ROUTE_IMPORTED)
                SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
 
        if (peer->sort == BGP_PEER_IBGP || peer->sort == BGP_PEER_CONFED
@@ -1344,7 +1344,7 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
         * Currently presence of rmac in attr denotes
         * this is an EVPN type-2 route
         */
-       if (!is_zero_mac(&(info->attr->rmac)))
+       if (info->sub_type == BGP_ROUTE_IMPORTED)
                SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
 
        if (peer->sort == BGP_PEER_IBGP) {