diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in_pcb.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 28cc029..4e3a9a8 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -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) |