Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_stf.c
Context not available. | |||||
static int | static int | ||||
stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) | stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) | ||||
{ | { | ||||
struct rm_priotracker in_ifa_tracker; | |||||
struct ifaddr *ia; | struct ifaddr *ia; | ||||
struct in_ifaddr *ia4; | struct in_ifaddr *ia4; | ||||
struct in6_ifaddr *ia6; | struct in6_ifaddr *ia6; | ||||
Context not available. | |||||
continue; | continue; | ||||
bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); | bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); | ||||
IN_IFADDR_RLOCK(&in_ifa_tracker); | |||||
LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) | LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) | ||||
if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) | if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) | ||||
break; | break; | ||||
IN_IFADDR_RUNLOCK(&in_ifa_tracker); | |||||
mav: Wouldn't it be better to use in_localip() here instead of code duplication? Or I miss… | |||||
eugen_grosbein.netAuthorUnsubmitted Done Inline Actionsin_localip() may be better, I just wished to make the patch as clear as possible minizing changes for first revision. eugen_grosbein.net: in_localip() may be better, I just wished to make the patch as clear as possible minizing… | |||||
aeUnsubmitted Not Done Inline ActionsUsing in_localip() is preferred, because INADDR_HASH is protected with rmlock only in head/ and stable/11. So if you plan to merge this into stable/10, you will need to do direct commit. ae: Using in_localip() is preferred, because INADDR_HASH is protected with rmlock only in head/ and… | |||||
eugen_grosbein.netAuthorUnsubmitted Not Done Inline ActionsGot it, thanks. eugen_grosbein.net: Got it, thanks. | |||||
if (ia4 == NULL) | if (ia4 == NULL) | ||||
continue; | continue; | ||||
Context not available. |
Wouldn't it be better to use in_localip() here instead of code duplication? Or I miss something?