svn commit: r273733 - head/sys/netinet/cc

George Neville-Neil gnn at neville-neil.com
Mon Oct 27 15:46:03 UTC 2014


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 <jau789 at gmail.com>
> 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();


More information about the svn-src-all mailing list