Prison check addresses set with multicast interface options.

Reviewed by:	bz
MFC after:	1 week
This commit is contained in:
Daniel Eischen
2011-01-26 17:31:03 +00:00
parent f89f7ada8d
commit e691be70f9
+9 -6
View File
@@ -889,17 +889,20 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam,
if (imo->imo_multicast_ifp != NULL) {
ifp = imo->imo_multicast_ifp;
IN_IFADDR_RLOCK();
TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link)
if (ia->ia_ifp == ifp)
TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if ((ia->ia_ifp == ifp) &&
(cred == NULL ||
prison_check_ip4(cred,
&ia->ia_addr.sin_addr) == 0))
break;
if (ia == NULL) {
IN_IFADDR_RUNLOCK();
}
if (ia == NULL)
error = EADDRNOTAVAIL;
} else {
else {
laddr = ia->ia_addr.sin_addr;
IN_IFADDR_RUNLOCK();
error = 0;
}
IN_IFADDR_RUNLOCK();
}
}
if (error)