diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-04-04 15:27:36 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 15:27:36 +0300 |
| commit | c9628fd3012783ce48312bd181b9888a825af093 (patch) | |
| tree | 027a143d9ae3ef6f7c2d9b80b5cc2dbe31a5e617 | |
| parent | b109cef92d23b58cbfd81b9ececca760e7c3bf2e (diff) | |
| parent | 988cbf4334a7fa2f637acb9d0fec199ec4ec822c (diff) | |
Merge pull request #13203 from FRRouting/mergify/bp/stable/8.5/pr-13198
bgpd: bmp fix peer-up ports byte order (backport #13198)
| -rw-r--r-- | bgpd/bgp_bmp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 41b6fe37ff..dbc356bc40 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -402,13 +402,13 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down) /* Local Port, Remote Port */ if (peer->su_local->sa.sa_family == AF_INET6) - stream_putw(s, 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) - stream_putw(s, peer->su_local->sin.sin_port); + stream_putw(s, htons(peer->su_local->sin.sin_port)); if (peer->su_remote->sa.sa_family == AF_INET6) - stream_putw(s, peer->su_remote->sin6.sin6_port); + stream_putw(s, htons(peer->su_remote->sin6.sin6_port)); else if (peer->su_remote->sa.sa_family == AF_INET) - stream_putw(s, peer->su_remote->sin.sin_port); + stream_putw(s, htons(peer->su_remote->sin.sin_port)); static const uint8_t dummy_open[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
