diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index a9fceb6cde..047b9742ee 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -586,7 +586,7 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn, uint8_t flags, uint32_t seq, esi_t *esi) { struct stream *s; - int ipa_len; + uint16_t ipa_len; static struct in_addr zero_remote_vtep_ip; /* Check socket. */ @@ -614,11 +614,11 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn, stream_put(s, &p->prefix.macip_addr.mac.octet, ETH_ALEN); /* Mac Addr */ /* IP address length and IP address, if any. */ if (is_evpn_prefix_ipaddr_none(p)) - stream_putl(s, 0); + stream_putw(s, 0); else { ipa_len = is_evpn_prefix_ipaddr_v4(p) ? IPV4_MAX_BYTELEN : IPV6_MAX_BYTELEN; - stream_putl(s, ipa_len); + stream_putw(s, ipa_len); stream_put(s, &p->prefix.macip_addr.ip.ip.addr, ipa_len); } /* If the ESI is valid that becomes the nexthop; tape out the diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 4cd3b60a0f..3ac7ee8f4f 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3749,7 +3749,7 @@ zebra_vxlan_remote_macip_helper(bool add, struct stream *s, vni_t *vni, memset(ip, 0, sizeof(*ip)); STREAM_GETL(s, *vni); STREAM_GET(macaddr->octet, s, ETH_ALEN); - STREAM_GETL(s, *ipa_len); + STREAM_GETW(s, *ipa_len); if (*ipa_len) { if (*ipa_len == IPV4_MAX_BYTELEN)