From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 21:02:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A62BE4; Thu, 20 Feb 2014 21:02:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 052991038; Thu, 20 Feb 2014 21:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KL2OYd053485; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KL2Of4053484; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402202102.s1KL2Of4053484@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 20 Feb 2014 21:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r262257 - stable/9/sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 21:02:25 -0000 Author: ae Date: Thu Feb 20 21:02:24 2014 New Revision: 262257 URL: http://svnweb.freebsd.org/changeset/base/262257 Log: MFC r261835: Drop packets to multicast address whose scop field contains the reserved value 0. Sponsored by: Yandex LLC Modified: stable/9/sys/netinet6/ip6_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:01:59 2014 (r262256) +++ stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:02:24 2014 (r262257) @@ -558,7 +558,18 @@ ip6_input(struct mbuf *m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && + IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) { + /* + * RFC4291 2.7: + * Nodes must not originate a packet to a multicast address + * whose scop field contains the reserved value 0; if such + * a packet is received, it must be silently dropped. + */ + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); + goto bad; + } #ifdef ALTQ if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) { /* packet is dropped by traffic conditioner */