From owner-svn-src-projects@FreeBSD.ORG Tue Jul 7 16:10:54 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4984B1065676; Tue, 7 Jul 2009 16:10:54 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BE38FC2A; Tue, 7 Jul 2009 16:10:54 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n67GAsYs023079; Tue, 7 Jul 2009 16:10:54 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n67GAs8f023076; Tue, 7 Jul 2009 16:10:54 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200907071610.n67GAs8f023076@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 7 Jul 2009 16:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195425 - projects/tcp_cc_8.x/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 16:10:54 -0000 Author: lstewart Date: Tue Jul 7 16:10:53 2009 New Revision: 195425 URL: http://svn.freebsd.org/changeset/base/195425 Log: - Don't manually add newreno to the cc_list in tcp_init, as the DECLARE_CC_MODULE macro in the new world order takes care of registering the module for us. Add a KASSERT when initing a tcpcb to check that the list is not empty. - sysctl_handle_string is not required in the case where we are setting a new default algorithm. This change fixes a panic that would occur when trying to set the default algorithm. Modified: projects/tcp_cc_8.x/sys/netinet/cc.c projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Modified: projects/tcp_cc_8.x/sys/netinet/cc.c ============================================================================== --- projects/tcp_cc_8.x/sys/netinet/cc.c Tue Jul 7 13:58:47 2009 (r195424) +++ projects/tcp_cc_8.x/sys/netinet/cc.c Tue Jul 7 16:10:53 2009 (r195425) @@ -114,8 +114,6 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) if (!found) return (ESRCH); - - error = sysctl_handle_string(oidp, arg1, arg2, req); } return (error); @@ -160,8 +158,6 @@ cc_init() { CC_LIST_LOCK_INIT(); STAILQ_INIT(&cc_list); - /* Newreno must always be available as an algorithm. */ - cc_register_algo(&newreno_cc_algo); } /* Modified: projects/tcp_cc_8.x/sys/netinet/tcp_subr.c ============================================================================== --- projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Tue Jul 7 13:58:47 2009 (r195424) +++ projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Tue Jul 7 16:10:53 2009 (r195425) @@ -734,6 +734,7 @@ tcp_newtcpcb(struct inpcb *inp) * Use the current system default CC algorithm. */ CC_LIST_RLOCK(); + KASSERT(!STAILQ_EMPTY(&cc_list), ("cc_list is empty!")); CC_ALGO(tp) = CC_DEFAULT(); CC_LIST_RUNLOCK();