Skip to content
Snippets Groups Projects
Commit 5b0fb968 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dhtrunner: return port in host byte order

parent 7733d293
No related branches found
No related tags found
No related merge requests found
...@@ -226,11 +226,11 @@ public: ...@@ -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. * @param f: address family of the bound port to retreive.
*/ */
in_port_t getBoundPort(sa_family_t f = AF_INET) const { 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 { std::vector<NodeExport> exportNodes() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment