From 0f31960fb4bf066b4afa4c74bed5838816fec729 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Sun, 28 Sep 2014 21:11:31 +0100 Subject: [PATCH] convert port to host notation --- include/tr/socket.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tr/socket.h b/include/tr/socket.h index 6fb1457..4c66c1c 100644 --- a/include/tr/socket.h +++ b/include/tr/socket.h @@ -90,9 +90,9 @@ TR_CLASSVARS_DECL(TR_Socket) {}; #define TR_socketAddrPort(socket) \ ((socket)->addr.info.sa_family == AF_INET \ - ? (socket)->addr.in.sin_port \ + ? ntohs((socket)->addr.in.sin_port) \ : (socket)->addr.info.sa_family == AF_INET6 \ - ? (socket)->addr.in6.sin6_port \ + ? ntohs((socket)->addr.in6.sin6_port) \ : 0) #define TR_socketAddrIp(socket) \