mirror of
https://github.com/opnsense/src.git
synced 2026-02-04 03:00:53 -06:00
netinet: Make in_localaddr() return bool
It is used as a boolean function everywhere. No functional change intended. MFC after: 1 week (cherry picked from commit 69beb162848b15c967d3b45ac56501dbd8b94e91)
This commit is contained in:
parent
f4138e6c1e
commit
dacf15eb76
@ -129,10 +129,10 @@ static struct sx in_control_sx;
|
||||
SX_SYSINIT(in_control_sx, &in_control_sx, "in_control");
|
||||
|
||||
/*
|
||||
* Return 1 if an internet address is for a ``local'' host
|
||||
* Return true if an internet address is for a ``local'' host
|
||||
* (one to which we have a connection).
|
||||
*/
|
||||
int
|
||||
bool
|
||||
in_localaddr(struct in_addr in)
|
||||
{
|
||||
u_long i = ntohl(in.s_addr);
|
||||
@ -142,10 +142,10 @@ in_localaddr(struct in_addr in)
|
||||
|
||||
CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
|
||||
if ((i & ia->ia_subnetmask) == ia->ia_subnet)
|
||||
return (1);
|
||||
return (true);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -677,7 +677,7 @@ struct in_ifaddr;
|
||||
int in_broadcast(struct in_addr, struct ifnet *);
|
||||
int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *);
|
||||
int in_canforward(struct in_addr);
|
||||
int in_localaddr(struct in_addr);
|
||||
bool in_localaddr(struct in_addr);
|
||||
bool in_localip(struct in_addr);
|
||||
bool in_localip_fib(struct in_addr, uint16_t);
|
||||
int in_ifhasaddr(struct ifnet *, struct in_addr);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user