diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-10-15 12:51:51 +0300 |
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-10-15 12:51:51 +0300 |
| commit | e15eb6a089ec8f61ab8ec5e887603796d070fb1c (patch) | |
| tree | 13a3c0e853d4ff25077f68d5c78260c0ca75bd47 | |
| parent | 5c194b36399afa3e90262234d9246e3383bbe015 (diff) | |
bgpd: Check if su_local/su_remote exist before encoding BMP peer state
Fixes: 035304c25a3890a040acbe23ca385750b062cdce ("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| -rw-r--r-- | bgpd/bgp_bmp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 08f8b8b734..bb24d5d69e 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -501,14 +501,14 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down) } /* Local Port, Remote Port */ - if (is_locrib) + if (!peer->su_local || is_locrib) stream_putw(s, 0); else if (peer->su_local->sa.sa_family == AF_INET6) stream_putw(s, htons(peer->su_local->sin6.sin6_port)); else if (peer->su_local->sa.sa_family == AF_INET) stream_putw(s, htons(peer->su_local->sin.sin_port)); - if (is_locrib) + if (!peer->su_remote || is_locrib) stream_putw(s, 0); else if (peer->su_remote->sa.sa_family == AF_INET6) stream_putw(s, htons(peer->su_remote->sin6.sin6_port)); |
