]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge branch 'master' of https://github.com/frrouting/frr into evpn-ipv6-tenant-routing
authorvivek <vivek@cumulusnetworks.com>
Tue, 6 Mar 2018 22:19:24 +0000 (22:19 +0000)
committervivek <vivek@cumulusnetworks.com>
Tue, 6 Mar 2018 22:19:24 +0000 (22:19 +0000)
Conflicts:
zebra/zserv.c

1  2 
bgpd/bgp_evpn.c
lib/ipaddr.h
zebra/zebra_rib.c
zebra/zserv.c

diff --cc bgpd/bgp_evpn.c
Simple merge
diff --cc lib/ipaddr.h
index e8dbe9cf09d4b6180a36fed0e8859689c7ec98e0,98c28008dc60a36ea6ea76cdf6244a84475ba08e..44bde45add60b25cec307e2d08cd440843840f60
@@@ -85,15 -85,4 +85,21 @@@ static inline char *ipaddr2str(struct i
        }
        return buf;
  }
 +
++/*
++ * Convert IPv4 address to IPv4-mapped IPv6 address which is of the
++ * form ::FFFF:<IPv4 address> (RFC 4291). This IPv6 address can then
++ * be used to represent the IPv4 address, wherever only an IPv6 address
++ * is required.
++ */
 +static inline void ipv4_to_ipv4_mapped_ipv6(struct in6_addr *in6,
 +                                          struct in_addr in)
 +{
 +      u_int32_t addr_type = htonl(0xFFFF);
 +
 +      memset(in6, 0, sizeof(struct in6_addr));
 +      memcpy((char *)in6 + 8, &addr_type, sizeof(addr_type));
 +      memcpy((char *)in6 + 12, &in, sizeof(struct in_addr));
 +}
 +
  #endif /* __IPADDR_H__ */
Simple merge
diff --cc zebra/zserv.c
index 1fc2bfd309bfa8d541e530a856c2eefd84fefb6e,bca8a509d82ededda2b0db02be3adb82d6ed9174..07258cdb72f0258847a41f53b86fe043cfe76f18
@@@ -1172,9 -1171,11 +1172,9 @@@ static int zread_route_add(struct zser
                        case NEXTHOP_TYPE_IPV4:
                                nexthop = route_entry_nexthop_ipv4_add(
                                        re, &api_nh->gate.ipv4, NULL,
-                                       re->vrf_id);
+                                       api_nh->vrf_id);
                                break;
 -                      case NEXTHOP_TYPE_IPV4_IFINDEX: {
 -
 -                              struct ipaddr vtep_ip;
 +                      case NEXTHOP_TYPE_IPV4_IFINDEX:
  
                                memset(&vtep_ip, 0, sizeof(struct ipaddr));
                                if (CHECK_FLAG(api.flags,
  
                                nexthop = route_entry_nexthop_ipv4_ifindex_add(
                                        re, &api_nh->gate.ipv4, NULL, ifindex,
-                                       re->vrf_id);
+                                       api_nh->vrf_id);
  
                                /* if this an EVPN route entry,
 -                                 program the nh as neigh
 +                               * program the nh as neigh
                                 */
                                if (CHECK_FLAG(api.flags,
                                               ZEBRA_FLAG_EVPN_ROUTE)) {
                                                                &api.prefix);
                                }
                                break;
 -                      }
                        case NEXTHOP_TYPE_IPV6:
                                nexthop = route_entry_nexthop_ipv6_add(
-                                       re, &api_nh->gate.ipv6, re->vrf_id);
+                                       re, &api_nh->gate.ipv6, api_nh->vrf_id);
                                break;
                        case NEXTHOP_TYPE_IPV6_IFINDEX:
 +                              memset(&vtep_ip, 0, sizeof(struct ipaddr));
 +                              if (CHECK_FLAG(api.flags,
 +                                             ZEBRA_FLAG_EVPN_ROUTE)) {
 +                                      ifindex =
 +                                              get_l3vni_svi_ifindex(vrf_id);
 +                              } else {
 +                                      ifindex = api_nh->ifindex;
 +                              }
 +
                                nexthop = route_entry_nexthop_ipv6_ifindex_add(
 -                                      re, &api_nh->gate.ipv6, api_nh->ifindex,
 +                                      re, &api_nh->gate.ipv6, ifindex,
-                                       re->vrf_id);
+                                       api_nh->vrf_id);
 +
 +                              /* if this an EVPN route entry,
 +                               * program the nh as neigh
 +                               */
 +                              if (CHECK_FLAG(api.flags,
 +                                             ZEBRA_FLAG_EVPN_ROUTE)) {
 +                                      SET_FLAG(nexthop->flags,
 +                                               NEXTHOP_FLAG_EVPN_RVTEP);
 +                                      vtep_ip.ipa_type = IPADDR_V6;
 +                                      memcpy(&vtep_ip.ipaddr_v6,
 +                                             &(api_nh->gate.ipv6),
 +                                             sizeof(struct in6_addr));
 +                                      zebra_vxlan_evpn_vrf_route_add(
 +                                                              vrf_id,
 +                                                              &api.rmac,
 +                                                              &vtep_ip,
 +                                                              &api.prefix);
 +                              }
                                break;
                        case NEXTHOP_TYPE_BLACKHOLE:
                                nexthop = route_entry_nexthop_blackhole_add(