net: Use network byte order for in_addr.s_addr

It is documented in the ip(7) manual page.
This commit is contained in:
Hennadii Stepanov committed 2020-09-29 09:59:43 +03:00
1 parent 7ea649946d
commit b3273cf403
1 file changed
+1 -1
+1 -1
View File
@@ -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);