summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-27 08:37:09 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-27 08:37:09 +0000
commit63648746bca8a5752ecfc73a64a621b188a1e719 (patch)
tree64562b7405bbec4d42a7cfbf2790a8f8d0e3696f /sys/netinet/ip_output.c
parent0f6d1bcc55b9410e51f77839c4b9f6eccd8d8cf7 (diff)
Replace INADDR_TO_IFP() by in_iawithaddr() and kill the macro.
ok mikeb@, ports@, henning@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 9a2372f22e1..2f0f519c0fb 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.250 2013/10/25 18:44:36 lteo Exp $ */
+/* $OpenBSD: ip_output.c,v 1.251 2013/11/27 08:37:08 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -1702,6 +1702,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m,
u_char loop;
int i;
struct in_addr addr;
+ struct in_ifaddr *ia;
struct ip_mreq *mreq;
struct ifnet *ifp;
struct ip_moptions *imo = *imop;
@@ -1753,7 +1754,9 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m,
* IP address. Find the interface and confirm that
* it supports multicasting.
*/
- INADDR_TO_IFP(addr, ifp, rtableid);
+ ia = in_iawithaddr(addr, rtableid);
+ if (ia)
+ ifp = ia->ia_ifp;
if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
error = EADDRNOTAVAIL;
break;
@@ -1820,7 +1823,9 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m,
ifp = ro.ro_rt->rt_ifp;
rtfree(ro.ro_rt);
} else {
- INADDR_TO_IFP(mreq->imr_interface, ifp, rtableid);
+ ia = in_iawithaddr(mreq->imr_interface, rtableid);
+ if (ia)
+ ifp = ia->ia_ifp;
}
/*
* See if we found an interface, and confirm that it
@@ -1906,11 +1911,12 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m,
if (mreq->imr_interface.s_addr == INADDR_ANY)
ifp = NULL;
else {
- INADDR_TO_IFP(mreq->imr_interface, ifp, rtableid);
- if (ifp == NULL) {
+ ia = in_iawithaddr(mreq->imr_interface, rtableid);
+ if (ia == NULL) {
error = EADDRNOTAVAIL;
break;
}
+ ifp = ia->ia_ifp;
}
/*
* Find the membership in the membership array.