Make the INADDR_TO_IFP macro use the IP address hash lookup instead of
walking the entire list of IP addresses. Pointed out by: bfumerola
This commit is contained in:
parent
f13ad20660
commit
a931d7ed29
@ -112,7 +112,7 @@ extern u_long in_ifaddrhmask; /* mask for hash table */
|
||||
{ \
|
||||
struct in_ifaddr *ia; \
|
||||
\
|
||||
TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) \
|
||||
LIST_FOREACH(ia, INADDR_HASH((addr).s_addr), ia_hash) \
|
||||
if (IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \
|
||||
break; \
|
||||
(ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
|
||||
|
Loading…
Reference in New Issue
Block a user