From owner-svn-src-head@FreeBSD.ORG Thu Nov 19 13:39:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B773F106566B; Thu, 19 Nov 2009 13:39:07 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A749E8FC18; Thu, 19 Nov 2009 13:39:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAJDd7TO008197; Thu, 19 Nov 2009 13:39:07 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJDd7MS008195; Thu, 19 Nov 2009 13:39:07 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200911191339.nAJDd7MS008195@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 19 Nov 2009 13:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199528 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 13:39:07 -0000 Author: bms Date: Thu Nov 19 13:39:07 2009 New Revision: 199528 URL: http://svn.freebsd.org/changeset/base/199528 Log: Adapt r197136 to IPv6 stack: Comment some flawed assumptions in in6p_join_group() about mixing SSM full-state and delta-based APIs. MFC after: 1 day Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Nov 19 13:33:23 2009 (r199527) +++ head/sys/netinet6/in6_mcast.c Thu Nov 19 13:39:07 2009 (r199528) @@ -1814,6 +1814,7 @@ in6p_join_group(struct inpcb *inp, struc ifp = NULL; imf = NULL; + lims = NULL; error = 0; is_new = 0; @@ -1934,9 +1935,25 @@ in6p_join_group(struct inpcb *inp, struc error = EINVAL; goto out_in6p_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). + * + * 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) { + if (lims != NULL /*&& + lims->im6sl_st[1] == MCAST_INCLUDE*/) { error = EADDRNOTAVAIL; goto out_in6p_locked; } @@ -1991,6 +2008,8 @@ in6p_join_group(struct inpcb *inp, struc * * 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 */