diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-13 10:20:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-13 10:20:29 +0100 |
| commit | c1a003878246ccc84ab5986558ca959f4545f738 (patch) | |
| tree | ce21bb09357d06dba932a5768257ce28028bba5f /zebra/zebra_rib.c | |
| parent | 18ba0693221986a380c0dd131e53c887fed1af09 (diff) | |
| parent | 4e262455a252c700f81df75fb8107d112062bba8 (diff) | |
Merge pull request #1806 from vivek-cumulus/evpn-ipv6-tenant-routing
*: EVPN symmetric routing for IPv6 tenant routes
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 1204da92fb..72dbfb12fc 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -305,6 +305,8 @@ struct nexthop *route_entry_nexthop_ipv6_ifindex_add(struct route_entry *re, nexthop->type = NEXTHOP_TYPE_IPV6_IFINDEX; nexthop->gate.ipv6 = *ipv6; nexthop->ifindex = ifindex; + if (CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); route_entry_nexthop_add(re, nexthop); @@ -421,6 +423,10 @@ static int nexthop_active(afi_t afi, struct route_entry *re, re->nexthop_mtu = 0; } + /* Next hops (remote VTEPs) for EVPN routes are fully resolved. */ + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN_RVTEP)) + return 1; + /* Skip nexthops that have been filtered out due to route-map */ /* The nexthops are specific to this route and so the same */ /* nexthop for a different route may not have this flag set */ @@ -859,9 +865,7 @@ static unsigned nexthop_active_check(struct route_node *rn, case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV4_IFINDEX: family = AFI_IP; - if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN_RVTEP)) - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); - else if (nexthop_active(AFI_IP, re, nexthop, set, rn)) + if (nexthop_active(AFI_IP, re, nexthop, set, rn)) SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); else UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); @@ -2554,10 +2558,17 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, struct ipaddr vtep_ip; memset(&vtep_ip, 0, sizeof(struct ipaddr)); - vtep_ip.ipa_type = IPADDR_V4; - memcpy(&(vtep_ip.ipaddr_v4), - &(tmp_nh->gate.ipv4), - sizeof(struct in_addr)); + if (afi == AFI_IP) { + vtep_ip.ipa_type = IPADDR_V4; + memcpy(&(vtep_ip.ipaddr_v4), + &(tmp_nh->gate.ipv4), + sizeof(struct in_addr)); + } else { + vtep_ip.ipa_type = IPADDR_V6; + memcpy(&(vtep_ip.ipaddr_v6), + &(tmp_nh->gate.ipv6), + sizeof(struct in6_addr)); + } zebra_vxlan_evpn_vrf_route_del(re->vrf_id, rmac, &vtep_ip, p); } |
