Skip to content

Commit

Permalink
Merge pull request #2137 from mkanjari/evpn-addr-change
Browse files Browse the repository at this point in the history
*: change struct evpn_addr to include a union of all evpn route types
  • Loading branch information
riw777 committed May 8, 2018
2 parents 75a73ee + 3714a38 commit ae57fcb
Show file tree
Hide file tree
Showing 7 changed files with 304 additions and 173 deletions.
14 changes: 8 additions & 6 deletions bgpd/bgp_attr_evpn.c
Expand Up @@ -227,16 +227,18 @@ extern int bgp_build_evpn_prefix(int evpn_type, uint32_t eth_tag,
dst->family = AF_EVPN;
p_evpn_p->route_type = evpn_type;
if (evpn_type == BGP_EVPN_IP_PREFIX_ROUTE) {
p_evpn_p->eth_tag = eth_tag;
p_evpn_p->ip_prefix_length = p2.prefixlen;
p_evpn_p->prefix_addr.eth_tag = eth_tag;
p_evpn_p->prefix_addr.ip_prefix_length = p2.prefixlen;
if (src->family == AF_INET) {
SET_IPADDR_V4(&p_evpn_p->ip);
memcpy(&p_evpn_p->ip.ipaddr_v4, &src->u.prefix4,
SET_IPADDR_V4(&p_evpn_p->prefix_addr.ip);
memcpy(&p_evpn_p->prefix_addr.ip.ipaddr_v4,
&src->u.prefix4,
sizeof(struct in_addr));
dst->prefixlen = (uint8_t)PREFIX_LEN_ROUTE_TYPE_5_IPV4;
} else {
SET_IPADDR_V6(&p_evpn_p->ip);
memcpy(&p_evpn_p->ip.ipaddr_v6, &src->u.prefix6,
SET_IPADDR_V6(&p_evpn_p->prefix_addr.ip);
memcpy(&p_evpn_p->prefix_addr.ip.ipaddr_v6,
&src->u.prefix6,
sizeof(struct in6_addr));
dst->prefixlen = (uint8_t)PREFIX_LEN_ROUTE_TYPE_5_IPV6;
}
Expand Down

0 comments on commit ae57fcb

Please sign in to comment.