diff options
author | vivek <vivek@cumulusnetworks.com> | 2018-02-28 03:07:23 +0100 |
---|---|---|
committer | vivek <vivek@cumulusnetworks.com> | 2018-02-28 03:07:23 +0100 |
commit | 1ec31309bb056e4492ebf50a12e8bb29a9c4b29a (patch) | |
tree | d12d44809b97e72312160bce4bfb4954323aaa32 /lib/ipaddr.h | |
parent | Merge pull request #1788 from mkanjari/evpn-bugs (diff) | |
download | frr-1ec31309bb056e4492ebf50a12e8bb29a9c4b29a.tar.xz frr-1ec31309bb056e4492ebf50a12e8bb29a9c4b29a.zip |
*: EVPN symmetric routing for IPv6 tenant routes
Implement support for EVPN symmetric routing for IPv6 routes. The next hop
for EVPN routes is the IP address of the remote VTEP which is only an IPv4
address. This means that for IPv6 symmetric routing, there will be IPv6
destinations with IPv4 next hops. To make this work, the IPv4 next hops are
converted into IPv4-mapped IPv6 addresses.
As part of support, ensure that "L3" route-targets are not announced with
IPv6 link-local addresses so that they won't be installed in the routing
table.
Signed-off-by: Vivek Venkatraman vivek@cumulusnetworks.com
Reviewed-by: Mitesh Kanjariya mitesh@cumulusnetworks.com
Reviewed-by: Donald Sharp sharpd@cumulusnetworks.com
Diffstat (limited to 'lib/ipaddr.h')
-rw-r--r-- | lib/ipaddr.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h index 98c28008d..3857b8302 100644 --- a/lib/ipaddr.h +++ b/lib/ipaddr.h @@ -85,4 +85,14 @@ static inline char *ipaddr2str(struct ipaddr *ip, char *buf, int size) } return buf; } + +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__ */ |