Skip to content

Commit b3273cf

Browse files
committed
net: Use network byte order for in_addr.s_addr
It is documented in the ip(7) manual page.
1 parent 7ea6499 commit b3273cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,7 @@ bool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<N
23222322
}
23232323
if (binds.empty() && whiteBinds.empty()) {
23242324
struct in_addr inaddr_any;
2325-
inaddr_any.s_addr = INADDR_ANY;
2325+
inaddr_any.s_addr = htonl(INADDR_ANY);
23262326
struct in6_addr inaddr6_any = IN6ADDR_ANY_INIT;
23272327
fBound |= Bind(CService(inaddr6_any, GetListenPort()), BF_NONE, NetPermissionFlags::PF_NONE);
23282328
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE, NetPermissionFlags::PF_NONE);

0 commit comments

Comments
 (0)