From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 02:47:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3E76C0F; Sat, 8 Nov 2014 02:47:23 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C5BF03; Sat, 8 Nov 2014 02:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82lNNB017364; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82lNBP017363; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080247.sA82lNBP017363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274265 - stable/10/sys/netinet6 X-SVN-Group: stable-10 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.18-1 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: Sat, 08 Nov 2014 02:47:24 -0000 Author: bryanv Date: Sat Nov 8 02:47:23 2014 New Revision: 274265 URL: https://svnweb.freebsd.org/changeset/base/274265 Log: MFC r272801: Move the calls to u_tun_func() into udp6_append() A similar cleanup for UDPv4 was performed in r220620. Modified: stable/10/sys/netinet6/udp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:40:00 2014 (r274264) +++ stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) @@ -139,9 +139,18 @@ udp6_append(struct inpcb *inp, struct mb { struct socket *so; struct mbuf *opts; + struct udpcb *up; INP_LOCK_ASSERT(inp); + /* + * Engage the tunneling protocol. + */ + up = intoudpcb(inp); + if (up->u_tun_func != NULL) { + (*up->u_tun_func)(n, off, inp); + return; + } #ifdef IPSEC /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { @@ -359,20 +368,7 @@ udp6_input(struct mbuf **mp, int *offp, if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { INP_RLOCK(last); - up = intoudpcb(last); - if (up->u_tun_func == NULL) { - udp6_append(last, n, off, &fromsa); - } else { - /* - * Engage the tunneling - * protocol we will have to - * leave the info_lock up, - * since we are hunting - * through multiple UDP's. - * - */ - (*up->u_tun_func)(n, off, last); - } + udp6_append(last, n, off, &fromsa); INP_RUNLOCK(last); } } @@ -402,16 +398,8 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); - up = intoudpcb(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (up->u_tun_func == NULL) { - udp6_append(last, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - (*up->u_tun_func)(m, off, last); - } + udp6_append(last, m, off, &fromsa); INP_RUNLOCK(last); return (IPPROTO_DONE); } @@ -490,15 +478,7 @@ udp6_input(struct mbuf **mp, int *offp, } } UDP_PROBE(receive, NULL, inp, ip6, inp, uh); - if (up->u_tun_func == NULL) { - udp6_append(inp, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - - (*up->u_tun_func)(m, off, inp); - } + udp6_append(inp, m, off, &fromsa); INP_RUNLOCK(inp); return (IPPROTO_DONE);