diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h index 8a7b07e0..f37105eb 100644 --- a/include/opendht/dhtrunner.h +++ b/include/opendht/dhtrunner.h @@ -226,11 +226,11 @@ public: } /** - * Returns the currently bound port. + * Returns the currently bound port, in host byte order. * @param f: address family of the bound port to retreive. */ in_port_t getBoundPort(sa_family_t f = AF_INET) const { - return ((sockaddr_in*)&getBound(f).first)->sin_port; + return ntohs(((sockaddr_in*)&getBound(f).first)->sin_port); } std::vector exportNodes() const {