mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-17 22:55:43 +00:00
Merge pull request #17103 from opensourcerouting/fix/null_ptr_dereference_bmp_bgp
bgpd: Check if su_local/su_remote exist before encoding BMP peer state
This commit is contained in:
commit
00e8609e6f
@ -501,14 +501,14 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Local Port, Remote Port */
|
/* Local Port, Remote Port */
|
||||||
if (is_locrib)
|
if (!peer->su_local || is_locrib)
|
||||||
stream_putw(s, 0);
|
stream_putw(s, 0);
|
||||||
else if (peer->su_local->sa.sa_family == AF_INET6)
|
else if (peer->su_local->sa.sa_family == AF_INET6)
|
||||||
stream_putw(s, htons(peer->su_local->sin6.sin6_port));
|
stream_putw(s, htons(peer->su_local->sin6.sin6_port));
|
||||||
else if (peer->su_local->sa.sa_family == AF_INET)
|
else if (peer->su_local->sa.sa_family == AF_INET)
|
||||||
stream_putw(s, htons(peer->su_local->sin.sin_port));
|
stream_putw(s, htons(peer->su_local->sin.sin_port));
|
||||||
|
|
||||||
if (is_locrib)
|
if (!peer->su_remote || is_locrib)
|
||||||
stream_putw(s, 0);
|
stream_putw(s, 0);
|
||||||
else if (peer->su_remote->sa.sa_family == AF_INET6)
|
else if (peer->su_remote->sa.sa_family == AF_INET6)
|
||||||
stream_putw(s, htons(peer->su_remote->sin6.sin6_port));
|
stream_putw(s, htons(peer->su_remote->sin6.sin6_port));
|
||||||
|
Loading…
Reference in New Issue
Block a user