Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174441840
D55345.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D55345.diff
View Options
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -213,8 +213,8 @@
* Obviously the IGMPv3 per-interface state has per-vimage granularity
* also as a result.
*
- * FUTURE: Stop using IFP_TO_IA/INADDR_ANY, and use source address selection
- * policy to control the address used by IGMP on the link.
+ * FUTURE: Use source address selection policy to control the address
+ * used by IGMP on the link.
*/
VNET_DEFINE_STATIC(int, interface_timers_running); /* IGMPv3 general
* query response */
@@ -1283,7 +1283,7 @@
* Replace 0.0.0.0 with the subnet address if told to do so.
*/
if (V_igmp_recvifkludge && in_nullhost(ip->ip_src)) {
- IFP_TO_IA(ifp, ia);
+ ia = in_ifprimaryaddr(ifp);
if (ia != NULL)
ip->ip_src.s_addr = htonl(ia->ia_subnet);
}
@@ -1377,7 +1377,7 @@
* leave requires knowing that we are the only member of a
* group.
*/
- IFP_TO_IA(ifp, ia);
+ ia = in_ifprimaryaddr(ifp);
if (ia != NULL && in_hosteq(ip->ip_src, IA_SIN(ia)->sin_addr)) {
return (0);
}
@@ -3600,7 +3600,7 @@
if (m->m_flags & M_IGMP_LOOP) {
struct in_ifaddr *ia;
- IFP_TO_IA(ifp, ia);
+ ia = in_ifprimaryaddr(ifp);
if (ia != NULL)
ip->ip_src = ia->ia_addr.sin_addr;
}
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -1768,7 +1768,7 @@
mreqn.imr_ifindex = ifp->if_index;
NET_EPOCH_ENTER(et);
- IFP_TO_IA(ifp, ia);
+ ia = in_ifprimaryaddr(ifp);
if (ia != NULL)
mreqn.imr_address =
IA_SIN(ia)->sin_addr;
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -151,21 +151,6 @@
(ifp) = (ia == NULL) ? NULL : ia->ia_ifp; \
}
-/*
- * Macro for finding the internet address structure (in_ifaddr) corresponding
- * to a given interface (ifnet structure). DEPRECATED.
- */
-#define IFP_TO_IA(ifp, ia) \
- /* struct ifnet *ifp; */ \
- /* struct in_ifaddr *ia; */ \
-do { \
- NET_EPOCH_ASSERT(); \
- for ((ia) = CK_STAILQ_FIRST(&V_in_ifaddrhead); \
- (ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = CK_STAILQ_NEXT((ia), ia_link)) \
- continue; \
-} while (0)
-
/*
* Legacy IPv4 IGMP per-link structure.
*/
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -459,7 +459,7 @@
*/
ifp = imo->imo_multicast_ifp;
mtu = ifp->if_mtu;
- IFP_TO_IA(ifp, ia);
+ ia = in_ifprimaryaddr(ifp);
isbroadcast = false;
/* Interface may have no addresses. */
if (ia != NULL)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 4, 6:09 AM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40176809
Default Alt Text
D55345.diff (2 KB)
Attached To
Mode
D55345: netinet: Use in_ifprimaryaddr() in place of IFP_TO_IA().
Attached
Detach File
Event Timeline
Log In to Comment