aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-07-18 06:56:22 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-07-18 06:56:22 +0000
commit2251a7cfe47f82e1bdf59110661c65d8a3655612 (patch)
tree42ea51dc31539870702e2da59fb19c64bfd460dc
parentd313203e85c01ec64e0bba4b7506a853e98d8795 (diff)
downloadsrc-2251a7cfe47f82e1bdf59110661c65d8a3655612.tar.gz
src-2251a7cfe47f82e1bdf59110661c65d8a3655612.zip
MFS: ipfw `me' fix.
Notes
Notes: svn path=/releng/4.3/; revision=79849
-rw-r--r--sys/netinet/in_var.h30
1 files changed, 10 insertions, 20 deletions
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index de2a6a6e16fc..dc6bcfc54a77 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -94,20 +94,11 @@ extern u_char inetctlerrmap[];
/* 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 @@ extern u_char inetctlerrmap[];
/* 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 in_multistep {
/* 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 @@ do { \
/* 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)