Skip to content

Commit

Permalink
net: Use network byte order for in_addr.s_addr
Browse files Browse the repository at this point in the history
It is documented in the ip(7) manual page.
  • Loading branch information
xanimo committed Feb 7, 2025
1 parent cb5d402 commit 5adf995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2305,8 +2305,8 @@ bool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<C
}
if (binds.empty() && whiteBinds.empty()) {
struct in_addr inaddr_any;
inaddr_any.s_addr = INADDR_ANY;
fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE);
inaddr_any.s_addr = htonl(INADDR_ANY);
fBound |= Bind(CService((in6_addr)IN6ADDR_ANY_INIT, GetListenPort()), BF_NONE);
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE);
}
return fBound;
Expand Down

0 comments on commit 5adf995

Please sign in to comment.