Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Sep 2009 20:37:44 +0000 (UTC)
From:      Bruce M Simpson <bms@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197136 - head/sys/netinet
Message-ID:  <200909122037.n8CKbiM9096864@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bms
Date: Sat Sep 12 20:37:44 2009
New Revision: 197136
URL: http://svn.freebsd.org/changeset/base/197136

Log:
  Comment some flawed assumptions in inp_join_group() about
  mixing SSM full-state and delta-based APIs.
  
  ENOTIME to fix right now.  No functional changes.
  
  MFC after:	5 days

Modified:
  head/sys/netinet/in_mcast.c

Modified: head/sys/netinet/in_mcast.c
==============================================================================
--- head/sys/netinet/in_mcast.c	Sat Sep 12 20:18:23 2009	(r197135)
+++ head/sys/netinet/in_mcast.c	Sat Sep 12 20:37:44 2009	(r197136)
@@ -1857,6 +1857,7 @@ inp_join_group(struct inpcb *inp, struct
 
 	ifp = NULL;
 	imf = NULL;
+	lims = NULL;
 	error = 0;
 	is_new = 0;
 
@@ -1974,9 +1975,25 @@ inp_join_group(struct inpcb *inp, struct
 				error = EINVAL;
 				goto out_inp_locked;
 			}
-			/* Throw out duplicates. */
+			/*
+			 * 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).
+			 *
+			 * in_msource is transactioned just as for anything
+			 * else in SSM -- but note naive use of inm_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 = imo_match_source(imo, idx, &ssa->sa);
-			if (lims != NULL) {
+			if (lims != NULL /*&&
+			    lims->imsl_st[1] == MCAST_INCLUDE*/) {
 				error = EADDRNOTAVAIL;
 				goto out_inp_locked;
 			}
@@ -2031,6 +2048,8 @@ inp_join_group(struct inpcb *inp, struct
 	 *
 	 * 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 */



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