Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Nov 2009 16:35:59 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 170815 for review
Message-ID:  <200911191635.nAJGZxgf017309@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=170815

Change 170815 by raj@raj_fdt on 2009/11/19 16:35:58

	IFC @170814

Affected files ...

.. //depot/projects/fdt/contrib/ipfilter/man/ipf.8#2 integrate
.. //depot/projects/fdt/sys/amd64/amd64/bpf_jit_machdep.c#3 integrate
.. //depot/projects/fdt/sys/boot/uboot/common/metadata.c#2 integrate
.. //depot/projects/fdt/sys/conf/files#4 integrate
.. //depot/projects/fdt/sys/i386/i386/bpf_jit_machdep.c#3 integrate
.. //depot/projects/fdt/sys/kern/vfs_subr.c#2 integrate
.. //depot/projects/fdt/sys/netinet/in_mcast.c#2 integrate
.. //depot/projects/fdt/sys/netinet6/in6_mcast.c#2 integrate
.. //depot/projects/fdt/sys/netinet6/raw_ip6.c#2 integrate
.. //depot/projects/fdt/sys/powerpc/powerpc/cpu.c#3 integrate

Differences ...

==== //depot/projects/fdt/contrib/ipfilter/man/ipf.8#2 (text+ko) ====

@@ -1,4 +1,4 @@
-.\" $FreeBSD: src/contrib/ipfilter/man/ipf.8,v 1.8 2007/06/04 02:54:34 darrenr Exp $
+.\" $FreeBSD: src/contrib/ipfilter/man/ipf.8,v 1.9 2009/11/19 08:10:24 darrenr Exp $
 .TH IPF 8
 .SH NAME
 ipf \- alters packet filtering lists for IP packet input and output
@@ -46,7 +46,7 @@
 \fBC\fB (-cc) for which two files - \fBip_rules.c\fP
 and \fBip_rules.h\fP are generated in the \fBCURRENT DIRECTORY\fP when
 \fBipf\fP is being run.  These files can be used with the
-\fBIPFILTER_COMPILED\fP kernel option to build filter rules staticly into
+\fBIPFILTER_COMPILED\fP kernel option to build filter rules staticlly into
 the kernel.
 .TP
 .B \-d

==== //depot/projects/fdt/sys/amd64/amd64/bpf_jit_machdep.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.16 2009/11/18 23:40:19 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.17 2009/11/19 15:45:24 jkim Exp $");
 
 #ifdef _KERNEL
 #include "opt_bpf.h"
@@ -491,7 +491,7 @@
 
 #ifdef _KERNEL
 		stream.ibuf = (char *)contigmalloc(stream.cur_ip, M_BPFJIT,
-		    M_NOWAIT, 0, ~0ULL, 16, 0);
+		    M_NOWAIT, 0, ~0UL, 16, 0);
 		if (stream.ibuf == NULL)
 			break;
 #else

==== //depot/projects/fdt/sys/boot/uboot/common/metadata.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/uboot/common/metadata.c,v 1.1 2008/09/03 15:52:05 raj Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/uboot/common/metadata.c,v 1.2 2009/11/19 16:25:41 raj Exp $");
 
 #include <stand.h>
 #include <sys/param.h>
@@ -231,6 +231,7 @@
 	struct preloaded_file	*fp;
 	struct file_metadata	*md;
 	int			c;
+	vm_offset_t a;
 
 	c = addr != 0;
 	/* start with the first module on the list, should be the kernel */
@@ -240,7 +241,8 @@
 		MOD_TYPE(addr, fp->f_type, c);
 		if (fp->f_args)
 			MOD_ARGS(addr, fp->f_args, c);
-		MOD_ADDR(addr, fp->f_addr, c);
+		a = fp->f_addr - __elfN(relocation_offset);
+		MOD_ADDR(addr, a, c);
 		MOD_SIZE(addr, fp->f_size, c);
 		for (md = fp->f_metadata; md != NULL; md = md->md_next) {
 			if (!(md->md_type & MODINFOMD_NOCOPY))

==== //depot/projects/fdt/sys/conf/files#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1484 2009/11/16 21:47:12 jkim Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1485 2009/11/19 16:26:07 mav Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -112,12 +112,12 @@
 cam/cam_xpt.c			optional scbus
 cam/ata/ata_all.c		optional scbus
 cam/ata/ata_xpt.c		optional scbus
+cam/ata/ata_pmp.c		optional scbus
 cam/scsi/scsi_xpt.c		optional scbus
 cam/scsi/scsi_all.c		optional scbus
 cam/scsi/scsi_cd.c		optional cd
 cam/scsi/scsi_ch.c		optional ch
-cam/ata/ata_da.c		optional da
-cam/ata/ata_pmp.c		optional da
+cam/ata/ata_da.c		optional ada | da
 cam/scsi/scsi_da.c		optional da
 cam/scsi/scsi_low.c		optional ct | ncv | nsp | stg
 cam/scsi/scsi_low_pisa.c	optional ct | ncv | nsp | stg

==== //depot/projects/fdt/sys/i386/i386/bpf_jit_machdep.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/bpf_jit_machdep.c,v 1.16 2009/11/18 23:40:19 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/bpf_jit_machdep.c,v 1.17 2009/11/19 15:45:24 jkim Exp $");
 
 #ifdef _KERNEL
 #include "opt_bpf.h"
@@ -514,7 +514,7 @@
 
 #ifdef _KERNEL
 		stream.ibuf = (char *)contigmalloc(stream.cur_ip, M_BPFJIT,
-		    M_NOWAIT, 0, ~0ULL, 16, 0);
+		    M_NOWAIT, 0, ~0UL, 16, 0);
 		if (stream.ibuf == NULL)
 			break;
 #else

==== //depot/projects/fdt/sys/kern/vfs_subr.c#2 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.770 2009/10/01 17:22:03 trasz Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.771 2009/11/19 14:33:03 jh Exp $");
 
 #include "opt_ddb.h"
 
@@ -2761,6 +2761,7 @@
 DB_SHOW_COMMAND(mount, db_show_mount)
 {
 	struct mount *mp;
+	struct vfsopt *opt;
 	struct statfs *sp;
 	struct vnode *vp;
 	char buf[512];
@@ -2866,6 +2867,18 @@
 	}
 	db_printf("    mnt_kern_flag = %s\n", buf);
 
+	db_printf("    mnt_opt = ");
+	opt = TAILQ_FIRST(mp->mnt_opt);
+	if (opt != NULL) {
+		db_printf("%s", opt->name);
+		opt = TAILQ_NEXT(opt, link);
+		while (opt != NULL) {
+			db_printf(", %s", opt->name);
+			opt = TAILQ_NEXT(opt, link);
+		}
+	}
+	db_printf("\n");
+
 	sp = &mp->mnt_stat;
 	db_printf("    mnt_stat = { version=%u type=%u flags=0x%016jx "
 	    "bsize=%ju iosize=%ju blocks=%ju bfree=%ju bavail=%jd files=%ju "

==== //depot/projects/fdt/sys/netinet/in_mcast.c#2 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet/in_mcast.c,v 1.34 2009/09/18 15:12:31 bms Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet/in_mcast.c,v 1.35 2009/11/19 13:21:37 bms Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1967,7 +1967,7 @@
 		imf = &imo->imo_mfilters[idx];
 		if (ssa->ss.ss_family != AF_UNSPEC) {
 			/*
-			 * MCAST_JOIN_SOURCE on an exclusive membership
+			 * MCAST_JOIN_SOURCE_GROUP on an exclusive membership
 			 * is an error. On an existing inclusive membership,
 			 * it just adds the source to the filter list.
 			 */

==== //depot/projects/fdt/sys/netinet6/in6_mcast.c#2 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/in6_mcast.c,v 1.9 2009/08/01 19:26:27 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/in6_mcast.c,v 1.14 2009/11/19 13:39:07 bms Exp $");
 
 #include "opt_inet6.h"
 
@@ -1814,6 +1814,7 @@
 
 	ifp = NULL;
 	imf = NULL;
+	lims = NULL;
 	error = 0;
 	is_new = 0;
 
@@ -1917,11 +1918,6 @@
 	 */
 	(void)in6_setscope(&gsa->sin6.sin6_addr, ifp, NULL);
 
-	/*
-	 * MCAST_JOIN_SOURCE on an exclusive membership is an error.
-	 * On an existing inclusive membership, it just adds the
-	 * source to the filter list.
-	 */
 	imo = in6p_findmoptions(inp);
 	idx = im6o_match_group(imo, ifp, &gsa->sa);
 	if (idx == -1) {
@@ -1929,16 +1925,53 @@
 	} else {
 		inm = imo->im6o_membership[idx];
 		imf = &imo->im6o_mfilters[idx];
-		if (ssa->ss.ss_family != AF_UNSPEC &&
-		    imf->im6f_st[1] != MCAST_INCLUDE) {
+		if (ssa->ss.ss_family != AF_UNSPEC) {
+			/*
+			 * MCAST_JOIN_SOURCE_GROUP on an exclusive membership
+			 * is an error. On an existing inclusive membership,
+			 * it just adds the source to the filter list.
+			 */
+			if (imf->im6f_st[1] != MCAST_INCLUDE) {
+				error = EINVAL;
+				goto out_in6p_locked;
+			}
+			/*
+			 * Throw out duplicates.
+			 *
+			 * XXX FIXME: This makes a naive assumption that
+			 * even if entries exist for *ssa in this imf,
+			 * they will be rejected as dupes, even if they
+			 * are not valid in the current mode (in-mode).
+			 *
+			 * in6_msource is transactioned just as for anything
+			 * else in SSM -- but note naive use of in6m_graft()
+			 * below for allocating new filter entries.
+			 *
+			 * This is only an issue if someone mixes the
+			 * full-state SSM API with the delta-based API,
+			 * which is discouraged in the relevant RFCs.
+			 */
+			lims = im6o_match_source(imo, idx, &ssa->sa);
+			if (lims != NULL /*&&
+			    lims->im6sl_st[1] == MCAST_INCLUDE*/) {
+				error = EADDRNOTAVAIL;
+				goto out_in6p_locked;
+			}
+		} else {
+			/*
+			 * MCAST_JOIN_GROUP alone, on any existing membership,
+			 * is rejected, to stop the same inpcb tying up
+			 * multiple refs to the in_multi.
+			 * On an existing inclusive membership, this is also
+			 * an error; if you want to change filter mode,
+			 * you must use the userland API setsourcefilter().
+			 * XXX We don't reject this for imf in UNDEFINED
+			 * state at t1, because allocation of a filter
+			 * is atomic with allocation of a membership.
+			 */
 			error = EINVAL;
 			goto out_in6p_locked;
 		}
-		lims = im6o_match_source(imo, idx, &ssa->sa);
-		if (lims != NULL) {
-			error = EADDRNOTAVAIL;
-			goto out_in6p_locked;
-		}
 	}
 
 	/*
@@ -1970,7 +2003,13 @@
 	/*
 	 * Graft new source into filter list for this inpcb's
 	 * membership of the group. The in6_multi may not have
-	 * been allocated yet if this is a new membership.
+	 * been allocated yet if this is a new membership, however,
+	 * the in_mfilter slot will be allocated and must be initialized.
+	 *
+	 * Note: Grafting of exclusive mode filters doesn't happen
+	 * in this path.
+	 * XXX: Should check for non-NULL lims (node exists but may
+	 * not be in-mode) for interop with full-state API.
 	 */
 	if (ssa->ss.ss_family != AF_UNSPEC) {
 		/* Membership starts in IN mode */
@@ -1987,6 +2026,12 @@
 			error = ENOMEM;
 			goto out_im6o_free;
 		}
+	} else {
+		/* No address specified; Membership starts in EX mode */
+		if (is_new) {
+			CTR1(KTR_MLD, "%s: new join w/o source", __func__);
+			im6f_init(imf, MCAST_UNDEFINED, MCAST_EXCLUDE);
+		}
 	}
 
 	/*
@@ -2272,8 +2317,10 @@
 
 	if (is_final) {
 		/* Remove the gap in the membership array. */
-		for (++idx; idx < imo->im6o_num_memberships; ++idx)
+		for (++idx; idx < imo->im6o_num_memberships; ++idx) {
 			imo->im6o_membership[idx-1] = imo->im6o_membership[idx];
+			imo->im6o_mfilters[idx-1] = imo->im6o_mfilters[idx];
+		}
 		imo->im6o_num_memberships--;
 	}
 
@@ -2340,9 +2387,11 @@
 	if (error)
 		return (error);
 
-	if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc ||
-	    (msfr.msfr_fmode != MCAST_EXCLUDE &&
-	     msfr.msfr_fmode != MCAST_INCLUDE))
+	if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc)
+		return (ENOBUFS);
+
+	if (msfr.msfr_fmode != MCAST_EXCLUDE &&
+	    msfr.msfr_fmode != MCAST_INCLUDE)
 		return (EINVAL);
 
 	if (msfr.msfr_group.ss_family != AF_INET6 ||

==== //depot/projects/fdt/sys/netinet6/raw_ip6.c#2 (text+ko) ====

@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.111 2009/08/01 19:26:27 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.112 2009/11/19 11:55:19 bms Exp $");
 
 #include "opt_ipsec.h"
 #include "opt_inet6.h"
@@ -213,17 +213,39 @@
 		 */
 		if (in6p->in6p_moptions &&
 		    IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
-			struct sockaddr_in6 mcaddr;
+			/*
+			 * If the incoming datagram is for MLD, allow it
+			 * through unconditionally to the raw socket.
+			 *
+			 * Use the M_RTALERT_MLD flag to check for MLD
+			 * traffic without having to inspect the mbuf chain
+			 * more deeply, as all MLDv1/v2 host messages MUST
+			 * contain the Router Alert option.
+			 *
+			 * In the case of MLDv1, we may not have explicitly
+			 * joined the group, and may have set IFF_ALLMULTI
+			 * on the interface. im6o_mc_filter() may discard
+			 * control traffic we actually need to see.
+			 *
+			 * Userland multicast routing daemons should continue
+			 * filter the control traffic appropriately.
+			 */
 			int blocked;
 
-			bzero(&mcaddr, sizeof(struct sockaddr_in6));
-			mcaddr.sin6_len = sizeof(struct sockaddr_in6);
-			mcaddr.sin6_family = AF_INET6;
-			mcaddr.sin6_addr = ip6->ip6_dst;
+			blocked = MCAST_PASS;
+			if ((m->m_flags & M_RTALERT_MLD) == 0) {
+				struct sockaddr_in6 mcaddr;
+
+				bzero(&mcaddr, sizeof(struct sockaddr_in6));
+				mcaddr.sin6_len = sizeof(struct sockaddr_in6);
+				mcaddr.sin6_family = AF_INET6;
+				mcaddr.sin6_addr = ip6->ip6_dst;
 
-			blocked = im6o_mc_filter(in6p->in6p_moptions, ifp,
-			    (struct sockaddr *)&mcaddr,
-			    (struct sockaddr *)&fromsa);
+				blocked = im6o_mc_filter(in6p->in6p_moptions,
+				    ifp,
+				    (struct sockaddr *)&mcaddr,
+				    (struct sockaddr *)&fromsa);
+			}
 			if (blocked != MCAST_PASS) {
 				IP6STAT_INC(ip6s_notmember);
 				continue;

==== //depot/projects/fdt/sys/powerpc/powerpc/cpu.c#3 (text+ko) ====

@@ -55,7 +55,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * from $NetBSD: cpu_subr.c,v 1.1 2003/02/03 17:10:09 matt Exp $
- * $FreeBSD: src/sys/powerpc/powerpc/cpu.c,v 1.21 2009/11/06 06:09:04 marcel Exp $
+ * $FreeBSD: src/sys/powerpc/powerpc/cpu.c,v 1.22 2009/11/19 16:21:26 raj Exp $
  */
 
 #include <sys/param.h>
@@ -429,6 +429,8 @@
 {
 	register_t hid0;
 
+	printf("\n");
+
 	hid0 = mfspr(SPR_HID0);
 	printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK);
 }



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