From owner-svn-src-all@freebsd.org Fri May 27 17:31:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB95B4C39B; Fri, 27 May 2016 17:31:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2F2F810F4; Fri, 27 May 2016 17:31:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHV2Ub071583; Fri, 27 May 2016 17:31:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHV2oW071581; Fri, 27 May 2016 17:31:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605271731.u4RHV2oW071581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 27 May 2016 17:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300854 - in head/sys: netinet netinet6 X-SVN-Group: head 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.22 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: Fri, 27 May 2016 17:31:03 -0000 Author: glebius Date: Fri May 27 17:31:02 2016 New Revision: 300854 URL: https://svnweb.freebsd.org/changeset/base/300854 Log: Plug route reference underleak that happens with FLOWTABLE after r297225. Submitted by: Mike Karels Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri May 27 17:07:07 2016 (r300853) +++ head/sys/netinet/ip_output.c Fri May 27 17:31:02 2016 (r300854) @@ -701,7 +701,11 @@ sendit: IPSTAT_INC(ips_fragmented); done: - if (ro == &iproute) + /* + * Release the route if using our private route, or if + * (with flowtable) we don't have our own reference. + */ + if (ro == &iproute || ro->ro_flags & RT_NORTREF) RO_RTFREE(ro); else if (rte == NULL) /* Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 27 17:07:07 2016 (r300853) +++ head/sys/netinet6/ip6_output.c Fri May 27 17:31:02 2016 (r300854) @@ -1053,7 +1053,11 @@ sendorfree: IP6STAT_INC(ip6s_fragmented); done: - if (ro == &ip6route) + /* + * Release the route if using our private route, or if + * (with flowtable) we don't have our own reference. + */ + if (ro == &ip6route || ro->ro_flags & RT_NORTREF) RO_RTFREE(ro); return (error);