From owner-svn-src-all@FreeBSD.ORG Thu Dec 15 12:49:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F2B3106564A; Thu, 15 Dec 2011 12:49:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2968FC1D; Thu, 15 Dec 2011 12:49:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBFCnBXG048242; Thu, 15 Dec 2011 12:49:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBFCnBR2048240; Thu, 15 Dec 2011 12:49:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201112151249.pBFCnBR2048240@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 15 Dec 2011 12:49:11 +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: r228532 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Dec 2011 12:49:11 -0000 Author: glebius Date: Thu Dec 15 12:49:10 2011 New Revision: 228532 URL: http://svn.freebsd.org/changeset/base/228532 Log: Simplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib(). Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Dec 15 12:35:03 2011 (r228531) +++ head/sys/net/route.c Thu Dec 15 12:49:10 2011 (r228532) @@ -1128,8 +1128,7 @@ rtrequest1_fib(int req, struct rt_addrin ifa = info->rti_ifa; rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) { - if (ifa != NULL) - ifa_free(ifa); + ifa_free(ifa); senderr(ENOBUFS); } RT_LOCK_INIT(rt); @@ -1142,8 +1141,7 @@ rtrequest1_fib(int req, struct rt_addrin RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { RT_LOCK_DESTROY(rt); - if (ifa != NULL) - ifa_free(ifa); + ifa_free(ifa); uma_zfree(V_rtzone, rt); senderr(error); } @@ -1174,9 +1172,7 @@ rtrequest1_fib(int req, struct rt_addrin /* do not permit exactly the same dst/mask/gw pair */ if (rn_mpath_capable(rnh) && rt_mpath_conflict(rnh, rt, netmask)) { - if (rt->rt_ifa) { - ifa_free(rt->rt_ifa); - } + ifa_free(rt->rt_ifa); Free(rt_key(rt)); RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); @@ -1241,8 +1237,7 @@ rtrequest1_fib(int req, struct rt_addrin * then un-make it (this should be a function) */ if (rn == NULL) { - if (rt->rt_ifa) - ifa_free(rt->rt_ifa); + ifa_free(rt->rt_ifa); Free(rt_key(rt)); RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt);