From owner-svn-src-user@FreeBSD.ORG Thu Feb 14 00:43:37 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A2F3FF9; Thu, 14 Feb 2013 00:43:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1332CA87; Thu, 14 Feb 2013 00:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1E0havL087080; Thu, 14 Feb 2013 00:43:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1E0hamx087078; Thu, 14 Feb 2013 00:43:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201302140043.r1E0hamx087078@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 14 Feb 2013 00:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r246776 - user/ae/inet6/sys/netinet6 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2013 00:43:37 -0000 Author: ae Date: Thu Feb 14 00:43:36 2013 New Revision: 246776 URL: http://svnweb.freebsd.org/changeset/base/246776 Log: Fix typo s/m_hdr/m_pkthdr/. Don't reset rcvif pointer in the icmp6_error(), it is used to get proper zone information in the icmp6_reflect(). Remove in6_setscope() calls from the icmp6_error2(), set the needed rcvif instead. Modified: user/ae/inet6/sys/netinet6/icmp6.c Modified: user/ae/inet6/sys/netinet6/icmp6.c ============================================================================== --- user/ae/inet6/sys/netinet6/icmp6.c Wed Feb 13 23:25:11 2013 (r246775) +++ user/ae/inet6/sys/netinet6/icmp6.c Thu Feb 14 00:43:36 2013 (r246776) @@ -222,28 +222,11 @@ void icmp6_error2(struct mbuf *m, int type, int code, int param, struct ifnet *ifp) { - struct ip6_hdr *ip6; if (ifp == NULL) return; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, sizeof(struct ip6_hdr), ); -#else - if (m->m_len < sizeof(struct ip6_hdr)) { - m = m_pullup(m, sizeof(struct ip6_hdr)); - if (m == NULL) - return; - } -#endif - - ip6 = mtod(m, struct ip6_hdr *); - - if (in6_setscope(&ip6->ip6_src, ifp, NULL) != 0) - return; - if (in6_setscope(&ip6->ip6_dst, ifp, NULL) != 0) - return; - + m->m_pkthdr.rcvif = ifp; icmp6_error(m, type, code, param); } @@ -372,23 +355,11 @@ icmp6_error(struct mbuf *m, int type, in nip6->ip6_src = oip6->ip6_src; nip6->ip6_dst = oip6->ip6_dst; - in6_clearscope(&oip6->ip6_src); - in6_clearscope(&oip6->ip6_dst); - icmp6 = (struct icmp6_hdr *)(nip6 + 1); icmp6->icmp6_type = type; icmp6->icmp6_code = code; icmp6->icmp6_pptr = htonl((u_int32_t)param); - /* - * icmp6_reflect() is designed to be in the input path. - * icmp6_error() can be called from both input and output path, - * and if we are in output path rcvif could contain bogus value. - * clear m->m_pkthdr.rcvif for safety, we should have enough scope - * information in ip header (nip6). - */ - m->m_pkthdr.rcvif = NULL; - ICMP6STAT_INC(icp6s_outhist[type]); icmp6_reflect(m, sizeof(struct ip6_hdr)); /* header order: IPv6 - ICMPv6 */ @@ -2214,7 +2185,7 @@ icmp6_reflect(struct mbuf *m, size_t off * (for example) when we encounter an error while forwarding procedure * destined to a duplicated address of ours. */ - zoneid = in6_getscopezone(m->m_hdr.rcvif, + zoneid = in6_getscopezone(m->m_pkthdr.rcvif, in6_addrscope(&ip6->ip6_dst)); if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { ia = in6ifa_ifwithaddr(&ip6->ip6_dst, zoneid);