From owner-svn-src-head@FreeBSD.ORG Mon Oct 27 15:46:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34035C91; Mon, 27 Oct 2014 15:46:03 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9DF97A; Mon, 27 Oct 2014 15:46:02 +0000 (UTC) Received: from [209.211.73.8] (port=39658 helo=[172.16.19.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1XimUX-0001eM-IQ; Mon, 27 Oct 2014 11:45:59 -0400 From: "George Neville-Neil" To: "Hans Petter Selasky" Subject: Re: svn commit: r273733 - head/sys/netinet/cc Date: Mon, 27 Oct 2014 11:45:46 -0400 Message-ID: <4CE45B86-9B99-439D-B4BF-1AC61F4B78BB@neville-neil.com> In-Reply-To: <201410271121.s9RBLmOv095539@svn.freebsd.org> References: <201410271121.s9RBLmOv095539@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.8r4576) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 15:46:03 -0000 Can you modify this to preserve the limitation of TCP_CA_NAME_MAX ? Best, George On 27 Oct 2014, at 7:21, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 27 11:21:47 2014 > New Revision: 273733 > URL: https://svnweb.freebsd.org/changeset/base/273733 > > Log: > Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad > string comparison. > > MFC after: 3 days > Reported by: Jukka Ukkonen > Sponsored by: Mellanox Technologies > > Modified: > head/sys/netinet/cc/cc.c > > Modified: head/sys/netinet/cc/cc.c > ============================================================================== > --- head/sys/netinet/cc/cc.c Mon Oct 27 10:34:09 2014 (r273732) > +++ head/sys/netinet/cc/cc.c Mon Oct 27 11:21:47 2014 (r273733) > @@ -106,11 +106,13 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) > /* Find algo with specified name and set it to default. */ > CC_LIST_RLOCK(); > STAILQ_FOREACH(funcs, &cc_list, entries) { > - if (strncmp((char *)req->newptr, funcs->name, > - TCP_CA_NAME_MAX) == 0) { > - found = 1; > - V_default_cc_ptr = funcs; > - } > + /* NOTE: "newptr" is not zero terminated */ > + if (req->newlen != strlen(funcs->name)) > + continue; > + if (bcmp(req->newptr, funcs->name, req->newlen)) > + continue; > + found = 1; > + V_default_cc_ptr = funcs; > } > CC_LIST_RUNLOCK();