aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-22 13:42:47 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-29 09:59:43 +0300
commitb3273cf4039d26e66ae58a8acb9d865461618d54 (patch)
tree4b0da60dce8c396a6434bea91ba0ea37eda30dbf
parent7ea649946daa421ed7dfa478cbb0bcf2de3cc2f8 (diff)
net: Use network byte order for in_addr.s_addr
It is documented in the ip(7) manual page.
-rw-r--r--src/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 5b533d7d17..856a1b390d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2322,7 +2322,7 @@ bool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<N
}
if (binds.empty() && whiteBinds.empty()) {
struct in_addr inaddr_any;
- inaddr_any.s_addr = INADDR_ANY;
+ inaddr_any.s_addr = htonl(INADDR_ANY);
struct in6_addr inaddr6_any = IN6ADDR_ANY_INIT;
fBound |= Bind(CService(inaddr6_any, GetListenPort()), BF_NONE, NetPermissionFlags::PF_NONE);
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE, NetPermissionFlags::PF_NONE);