mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 18:44:54 +00:00
Merge pull request #1406 from donaldsharp/bgpd_ecommunity_crash
bgpd: Fix crash with ecommunity string
This commit is contained in:
commit
965a99f58a
@ -702,8 +702,12 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter)
|
|||||||
len = sprintf(
|
len = sprintf(
|
||||||
str_buf + str_pnt,
|
str_buf + str_pnt,
|
||||||
"EVPN:%02x:%02x:%02x:%02x:%02x:%02x",
|
"EVPN:%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
macaddr[0], macaddr[1], macaddr[2],
|
(uint8_t)macaddr[0],
|
||||||
macaddr[3], macaddr[4], macaddr[5]);
|
(uint8_t)macaddr[1],
|
||||||
|
(uint8_t)macaddr[2],
|
||||||
|
(uint8_t)macaddr[3],
|
||||||
|
(uint8_t)macaddr[4],
|
||||||
|
(uint8_t)macaddr[5]);
|
||||||
} else if (*pnt
|
} else if (*pnt
|
||||||
== ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY) {
|
== ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY) {
|
||||||
u_int32_t seqnum;
|
u_int32_t seqnum;
|
||||||
|
@ -2012,6 +2012,7 @@ static int bgp_capability_msg_parse(struct peer *peer, u_char *pnt,
|
|||||||
|
|
||||||
/* Fetch structure to the byte stream. */
|
/* Fetch structure to the byte stream. */
|
||||||
memcpy(&mpc, pnt + 3, sizeof(struct capability_mp_data));
|
memcpy(&mpc, pnt + 3, sizeof(struct capability_mp_data));
|
||||||
|
pnt += hdr->length + 3;
|
||||||
|
|
||||||
/* We know MP Capability Code. */
|
/* We know MP Capability Code. */
|
||||||
if (hdr->code == CAPABILITY_CODE_MP) {
|
if (hdr->code == CAPABILITY_CODE_MP) {
|
||||||
@ -2064,7 +2065,6 @@ static int bgp_capability_msg_parse(struct peer *peer, u_char *pnt,
|
|||||||
"%s unrecognized capability code: %d - ignored",
|
"%s unrecognized capability code: %d - ignored",
|
||||||
peer->host, hdr->code);
|
peer->host, hdr->code);
|
||||||
}
|
}
|
||||||
pnt += hdr->length + 3;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user