Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2011 08:51:46 +0000 (UTC)
From:      Daniel Eischen <deischen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r218256 - stable/8/sys/netinet
Message-ID:  <201102040851.p148pkp6075222@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: deischen
Date: Fri Feb  4 08:51:45 2011
New Revision: 218256
URL: http://svn.freebsd.org/changeset/base/218256

Log:
  MFC 217888
  
  Prison check addresses set with multicast interface options.

Modified:
  stable/8/sys/netinet/in_pcb.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/in_pcb.c
==============================================================================
--- stable/8/sys/netinet/in_pcb.c	Fri Feb  4 08:11:44 2011	(r218255)
+++ stable/8/sys/netinet/in_pcb.c	Fri Feb  4 08:51:45 2011	(r218256)
@@ -848,17 +848,20 @@ in_pcbconnect_setup(struct inpcb *inp, s
 			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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102040851.p148pkp6075222>