diff options
author | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2018-04-09 06:04:11 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-09 01:24:15 +0200 |
commit | f50dc5e6070383e803dc3441aedd5a435974c762 (patch) | |
tree | 2d570d0cf7836c4c046d9b059de4db5ace297a2e /lib/ipaddr.h | |
parent | watchfrr always writes 'log syslog informational' to the config (diff) | |
download | frr-f50dc5e6070383e803dc3441aedd5a435974c762.tar.xz frr-f50dc5e6070383e803dc3441aedd5a435974c762.zip |
zebra: remote RMAC for EVPN ipv6 hosts should be programmed against the ipv4 nexthop
For ipv6 host, the next hop is conevrted to ipv6 mapped address.
However, the remote rmac should still be programmed with the ipv4 address.
This is how the entries will look in the kernel for ipv6 hosts routing.
vrf routing table:
ipv6 -> ipv6_mapped remote vtep on l3vni SVI
neigh table:
ipv6_mapped remote vtep -> remote RMAC
bridge fdb:
remote rmac -> ipv4 vtep tunnel
Signed-off-by: Mitesh Kanjariya <mitesh@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 33591cb4e..7f2d06548 100644 --- a/lib/ipaddr.h +++ b/lib/ipaddr.h @@ -102,4 +102,14 @@ static inline void ipv4_to_ipv4_mapped_ipv6(struct in6_addr *in6, memcpy((char *)in6 + 12, &in, sizeof(struct in_addr)); } +/* + * convert an ipv4 mapped ipv6 address back to ipv4 address + */ +static inline void ipv4_mapped_ipv6_to_ipv4(struct in6_addr *in6, + struct in_addr *in) +{ + memset(in, 0, sizeof(struct in_addr)); + memcpy(in, (char *)in6 + 12, sizeof(struct in_addr)); +} + #endif /* __IPADDR_H__ */ |