summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxence Younsi <mx.yns@outlook.fr>2023-04-03 17:19:32 +0200
committerMaxence Younsi <mx.yns@outlook.fr>2023-04-03 17:19:32 +0200
commit9e681c84fa07d768d41fb8fba269c965c8c08a4b (patch)
treea88e32c114c2c6b8f6aaafc2ab76e49b59971d47
parentbdf62ec61b343adc007a93a66081d26d1483950a (diff)
bgpd: bmp fix peer-up ports byte order
added htons to ports in the peer-up message to fix byte order Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
-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,