dhtrunner: return port in host byte order

This commit is contained in:
Adrien Béraud committed 2015-10-21 01:41:23 -04:00
1 parent 7733d29326
commit 5b0fb9682b
1 file changed
+2 -2
+2 -2
View File
@@ -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 {