summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-04-04 10:49:09 +0300
committerGitHub <noreply@github.com>2023-04-04 10:49:09 +0300
commit6fc9bfb11ddf5c187bad91e1a759361d249f512f (patch)
tree0c5752a82a9f1abb99498216db563ceb5ede85db
parentd8492cf31a433dff4e9d6171a17486b6e7fbf31a (diff)
parent9e681c84fa07d768d41fb8fba269c965c8c08a4b (diff)
Merge pull request #13198 from mxyns/bmp-fix-peerup-port
bgpd: bmp fix peer-up ports byte order
-rw-r--r--bgpd/bgp_bmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 73dbf4ab2b..baf164679c 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -389,13 +389,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,