mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-10 15:24:20 +00:00
bgpd: Avoid padding for bgp_paths_limit_capability struct
When sending the packets over the network (dynamic capability) it reports 6 bytes instead of 5 bytes, and causes some issues between little/big endian machines. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
6ff16b3439
commit
081f6520ff
@ -25,7 +25,7 @@ struct bgp_paths_limit_capability {
|
||||
uint16_t afi;
|
||||
uint8_t safi;
|
||||
uint16_t paths_limit;
|
||||
};
|
||||
} __attribute__((packed));
|
||||
|
||||
#define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1
|
||||
|
||||
|
@ -3240,11 +3240,13 @@ static void bgp_dynamic_capability_paths_limit(uint8_t *pnt, int action,
|
||||
safi_t safi;
|
||||
iana_afi_t pkt_afi;
|
||||
iana_safi_t pkt_safi;
|
||||
uint16_t paths_limit = 0;
|
||||
struct bgp_paths_limit_capability bpl = {};
|
||||
|
||||
memcpy(&bpl, data, sizeof(bpl));
|
||||
pkt_afi = ntohs(bpl.afi);
|
||||
pkt_safi = safi_int2iana(bpl.safi);
|
||||
paths_limit = ntohs(bpl.paths_limit);
|
||||
|
||||
if (bgp_debug_neighbor_events(peer))
|
||||
zlog_debug("%s OPEN has %s capability for afi/safi: %s/%s limit: %u",
|
||||
@ -3252,8 +3254,7 @@ static void bgp_dynamic_capability_paths_limit(uint8_t *pnt, int action,
|
||||
lookup_msg(capcode_str, hdr->code,
|
||||
NULL),
|
||||
iana_afi2str(pkt_afi),
|
||||
iana_safi2str(pkt_safi),
|
||||
bpl.paths_limit);
|
||||
iana_safi2str(pkt_safi), paths_limit);
|
||||
|
||||
if (bgp_map_afi_safi_iana2int(pkt_afi, pkt_safi, &afi,
|
||||
&safi)) {
|
||||
@ -3275,7 +3276,7 @@ static void bgp_dynamic_capability_paths_limit(uint8_t *pnt, int action,
|
||||
SET_FLAG(peer->af_cap[afi][safi],
|
||||
PEER_CAP_PATHS_LIMIT_AF_RCV);
|
||||
peer->addpath_paths_limit[afi][safi].receive =
|
||||
bpl.paths_limit;
|
||||
paths_limit;
|
||||
ignore:
|
||||
data += CAPABILITY_CODE_PATHS_LIMIT_LEN;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user