Index: sys/netinet/in_var.h =================================================================== RCS file: /usr2/ncvs/src/sys/netinet/in_var.h,v retrieving revision 1.33.2.1 retrieving revision 1.33.2.2 diff -u -r1.33.2.1 -r1.33.2.2 --- sys/netinet/in_var.h 2001/05/14 08:23:49 1.33.2.1 +++ sys/netinet/in_var.h 2001/07/17 10:50:01 1.33.2.2 @@ -94,20 +94,11 @@ /* struct in_addr addr; */ \ /* struct ifnet *ifp; */ \ { \ - register struct in_ifaddr *ia; \ + struct in_ifaddr *ia; \ \ - for (ia = in_ifaddrhead.tqh_first; \ - ia != NULL && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \ - IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \ - ia = ia->ia_link.tqe_next) \ - continue; \ - if (ia == NULL) \ - for (ia = in_ifaddrhead.tqh_first; \ - ia != NULL; \ - ia = ia->ia_link.tqe_next) \ - if (ia->ia_ifp->if_flags & IFF_POINTOPOINT && \ - IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \ - break; \ + TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) \ + if (IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \ + break; \ (ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \ } @@ -119,9 +110,9 @@ /* struct ifnet *ifp; */ \ /* struct in_ifaddr *ia; */ \ { \ - for ((ia) = in_ifaddrhead.tqh_first; \ + for ((ia) = TAILQ_FIRST(&in_ifaddrhead); \ (ia) != NULL && (ia)->ia_ifp != (ifp); \ - (ia) = (ia)->ia_link.tqe_next) \ + (ia) = TAILQ_NEXT((ia), ia_link)) \ continue; \ } #endif @@ -182,10 +173,9 @@ /* struct ifnet *ifp; */ \ /* struct in_multi *inm; */ \ do { \ - register struct ifmultiaddr *ifma; \ + struct ifmultiaddr *ifma; \ \ - for (ifma = (ifp)->if_multiaddrs.lh_first; ifma; \ - ifma = ifma->ifma_link.le_next) { \ + LIST_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { \ if (ifma->ifma_addr->sa_family == AF_INET \ && ((struct sockaddr_in *)ifma->ifma_addr)->sin_addr.s_addr == \ (addr).s_addr) \ @@ -206,14 +196,14 @@ /* struct in_multi *inm; */ \ do { \ if (((inm) = (step).i_inm) != NULL) \ - (step).i_inm = (step).i_inm->inm_link.le_next; \ + (step).i_inm = LIST_NEXT((step).i_inm, inm_link); \ } while(0) #define IN_FIRST_MULTI(step, inm) \ /* struct in_multistep step; */ \ /* struct in_multi *inm; */ \ do { \ - (step).i_inm = in_multihead.lh_first; \ + (step).i_inm = LIST_FIRST(&in_multihead); \ IN_NEXT_MULTI((step), (inm)); \ } while(0)