diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h index 8a7b07e0ece18ade0039fd95f01a8199befef3f8..f37105eb114785c39dcf5aa99334b354f2040d83 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<NodeExport> exportNodes() const {