Now that joining an IPv4 multicast group does not require a
pre-configured address, we can safely convert this macro to
iterate over the local list of addresses.
I already got oks from bluhm@ and henning@ in the past, but
this diff was breaking some carp setups, so I appreciate any
new tests and oks.
Martin
Index: netinet/in_var.h
===================================================================
RCS file: /home/ncvs/src/sys/netinet/in_var.h,v
retrieving revision 1.31
diff -u -p -r1.31 in_var.h
--- netinet/in_var.h 29 Nov 2013 00:19:33 -0000 1.31
+++ netinet/in_var.h 7 Jan 2014 10:21:13 -0000
@@ -88,9 +88,12 @@ extern struct in_ifaddrhead in_ifaddr;
/* struct ifnet *ifp; */ \
/* struct in_ifaddr *ia; */ \
do { \
- TAILQ_FOREACH((ia), &in_ifaddr, ia_list) \
- if ((ia)->ia_ifp == (ifp)) \
+ struct ifaddr *ifa; \
+ TAILQ_FOREACH(ifa, &(ifp)->if_addrlist, ifa_list) { \
+ if (ifa->ifa_addr->sa_family == AF_INET) \
break; \
+ } \
+ (ia) = ifatoia(ifa); \
} while (/* CONSTCOND */ 0)
#endif