Prefer structure fields (ifa_link) to macro aliases for them
(ifa_list). MFC after: 2 weeks
This commit is contained in:
parent
82324826a9
commit
c4dd3fe108
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191340
@ -1689,7 +1689,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, struct mbuf *m, struct ifnet **ifpp,
|
||||
for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
|
||||
addrsofif = 0;
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
ifa6 = (struct in6_ifaddr *)ifa;
|
||||
@ -1776,7 +1776,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
|
||||
|
||||
for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
ifa6 = (struct in6_ifaddr *)ifa;
|
||||
|
@ -816,7 +816,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
||||
|
||||
ia->ia_ifa.ifa_refcnt = 1;
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_list);
|
||||
TAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
}
|
||||
|
||||
@ -1178,7 +1178,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
|
||||
int s = splnet();
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_list);
|
||||
TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
|
||||
oia = ia;
|
||||
@ -1231,7 +1231,7 @@ in6_purgeif(struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa, *nifa;
|
||||
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_list, nifa) {
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
in6_purgeaddr(ifa);
|
||||
@ -1414,7 +1414,7 @@ in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
|
||||
}
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
if (!cmp)
|
||||
@ -1513,7 +1513,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
|
||||
* and to validate the address if necessary.
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
ifacount++;
|
||||
@ -1629,7 +1629,7 @@ in6ifa_ifpforlinklocal(struct ifnet *ifp, int ignoreflags)
|
||||
struct ifaddr *ifa;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) {
|
||||
@ -1654,7 +1654,7 @@ in6ifa_ifpwithaddr(struct ifnet *ifp, struct in6_addr *addr)
|
||||
struct ifaddr *ifa;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
if (IN6_ARE_ADDR_EQUAL(addr, IFA_IN6(ifa)))
|
||||
@ -1860,7 +1860,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
|
||||
* If none, return one of global addresses assigned other ifs.
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
|
||||
@ -1896,7 +1896,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
|
||||
return (besta);
|
||||
}
|
||||
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
|
||||
@ -1935,7 +1935,7 @@ in6_if_up(struct ifnet *ifp)
|
||||
struct in6_ifaddr *ia;
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
ia = (struct in6_ifaddr *)ifa;
|
||||
|
@ -234,7 +234,7 @@ in6_get_hw_ifid(struct ifnet *ifp, struct in6_addr *in6)
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
|
||||
@ -766,14 +766,14 @@ in6_ifdetach(struct ifnet *ifp)
|
||||
nd6_purge(ifp);
|
||||
|
||||
/* nuke any of IPv6 addresses we have */
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_list, next) {
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
in6_purgeaddr(ifa);
|
||||
}
|
||||
|
||||
/* undo everything done by in6_ifattach(), just in case */
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_list, next) {
|
||||
TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6
|
||||
|| !IN6_IS_ADDR_LINKLOCAL(&satosin6(&ifa->ifa_addr)->sin6_addr)) {
|
||||
continue;
|
||||
@ -802,7 +802,7 @@ in6_ifdetach(struct ifnet *ifp)
|
||||
|
||||
/* remove from the linked list */
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_REMOVE(&ifp->if_addrhead, (struct ifaddr *)ia, ifa_list);
|
||||
TAILQ_REMOVE(&ifp->if_addrhead, (struct ifaddr *)ia, ifa_link);
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
IFAFREE(&ia->ia_ifa);
|
||||
|
||||
|
@ -503,7 +503,7 @@ MALLOC_DECLARE(M_IP6MADDR);
|
||||
/* struct in6_ifaddr *ia; */ \
|
||||
do { \
|
||||
struct ifaddr *ifa; \
|
||||
TAILQ_FOREACH(ifa, &(ifp)->if_addrhead, ifa_list) { \
|
||||
TAILQ_FOREACH(ifa, &(ifp)->if_addrhead, ifa_link) { \
|
||||
if (ifa->ifa_addr->sa_family == AF_INET6) \
|
||||
break; \
|
||||
} \
|
||||
|
@ -728,7 +728,7 @@ regen_tmpaddr(struct in6_ifaddr *ia6)
|
||||
|
||||
ifp = ia6->ia_ifa.ifa_ifp;
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
struct in6_ifaddr *it6;
|
||||
|
||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||
|
@ -1125,7 +1125,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
|
||||
* "address".
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
struct in6_ifaddr *ifa6;
|
||||
u_int32_t remaininglifetime;
|
||||
|
||||
@ -1598,7 +1598,7 @@ nd6_prefix_onlink(struct nd_prefix *pr)
|
||||
IN6_IFF_NOTREADY | IN6_IFF_ANYCAST);
|
||||
if (ifa == NULL) {
|
||||
/* XXX: freebsd does not have ifa_ifwithaf */
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_list) {
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
if (ifa->ifa_addr->sa_family == AF_INET6)
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user