summaryrefslogtreecommitdiff
path: root/bgpd/bgp_evpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r--bgpd/bgp_evpn.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 5ef593b9c0..c99f539c7b 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -4114,10 +4114,11 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
gw_afi = AF_INET;
} else {
SET_IPADDR_V6(&p.prefix.prefix_addr.ip);
- memcpy(&p.prefix.prefix_addr.ip.ipaddr_v6, pfx, 16);
- pfx += 16;
- memcpy(&evpn.gw_ip.ipv6, pfx, 16);
- pfx += 16;
+ memcpy(&p.prefix.prefix_addr.ip.ipaddr_v6, pfx,
+ IPV6_MAX_BYTELEN);
+ pfx += IPV6_MAX_BYTELEN;
+ memcpy(&evpn.gw_ip.ipv6, pfx, IPV6_MAX_BYTELEN);
+ pfx += IPV6_MAX_BYTELEN;
gw_afi = AF_INET6;
}