From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 10 22:40:17 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7106237B401 for ; Thu, 10 Jul 2003 22:40:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55B0943FAF for ; Thu, 10 Jul 2003 22:40:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6B5eGUp002066 for ; Thu, 10 Jul 2003 22:40:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6B5eGbp002065; Thu, 10 Jul 2003 22:40:16 -0700 (PDT) Resent-Date: Thu, 10 Jul 2003 22:40:16 -0700 (PDT) Resent-Message-Id: <200307110540.h6B5eGbp002065@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jose Marcio Martins da Cruz Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EB5337B401 for ; Thu, 10 Jul 2003 22:34:54 -0700 (PDT) Received: from horsey.gshapiro.net (horsey.gshapiro.net [64.105.95.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7389043F3F for ; Thu, 10 Jul 2003 22:34:53 -0700 (PDT) (envelope-from gshapiro@gshapiro.net) Received: from horsey.gshapiro.net (localhost [127.0.0.1]) h6B5Yqpa005964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Jul 2003 22:34:52 -0700 (PDT) Received: (from gshapiro@localhost)h6B5YqxE005963; Thu, 10 Jul 2003 22:34:52 -0700 (PDT) Message-Id: <200307110534.h6B5YqxE005963@horsey.gshapiro.net> Date: Thu, 10 Jul 2003 22:34:52 -0700 (PDT) From: Jose Marcio Martins da Cruz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/54354: Bug in inetd connection rate control X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2003 05:40:18 -0000 >Number: 54354 >Category: bin >Synopsis: Bug in inetd connection rate control >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 10 22:40:15 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Jose Marcio Martins da Cruz >Release: FreeBSD 4.8-STABLE i386 >Organization: Ecole des Mines de Paris >Environment: >Description: Hello, There seems to have a bug at inetd.c source file. This pb regards connection rate control feature. Line 2341 shall probably be : if ((cnt * 60) / (CHTSIZE * CHTGRAN) > sep->se_maxcpm) { ... instead of if (cnt * (CHTSIZE * CHTGRAN) / 60 > sep->se_maxcpm) { char pname[INET6_ADDRSTRLEN]; getnameinfo((struct sockaddr *)&rss, ((struct sockaddr *)&rss)->sa_len, pname, sizeof(pname), NULL, 0, NI_NUMERICHOST|NI_WITHSCOPEID); r = -1; syslog(LOG_ERR, "%s from %s exceeded counts/min (limit %d/min)", sep->se_service, pname, sep->se_maxcpm); } as the connection rate is the number of connections ***DIVIDED*** by the size of the measurement window. As long as you don't change original CHTSIZE and CHTGRAN values (6 and 10), this bug has no effect. This problem was remarked by Claus Assmann (ca@sendmail.org) and Jose Marcio Martins da Cruz (Jose-Marcio.Martins@ensmp.fr). Version information of the source file is : __FBSDID("$FreeBSD: src/usr.sbin/inetd/inetd.c,v 1.119 2003/02/23 16:54:19 dwmalone Exp $"); Best regards, Jose-Marcio -- --------------------------------------------------------------- Jose Marcio MARTINS DA CRUZ Tel. :(33) 01.40.51.93.41 Ecole des Mines de Paris http://j-chkmail.ensmp.fr 60, bd Saint Michel http://www.ensmp.fr/~martins 75272 - PARIS CEDEX 06 mailto:Jose-Marcio.Martins@ensmp.fr >How-To-Repeat: >Fix: --- inetd.c.org 2003-07-07 12:37:55.987790000 +0200 +++ inetd.c 2003-07-07 12:39:19.990674000 +0200 @@ -2338,7 +2338,7 @@ cnt += ct->ct_Count; } } - if (cnt * (CHTSIZE * CHTGRAN) / 60 > sep->se_maxcpm) { + if ((cnt * 60) / (CHTSIZE * CHTGRAN) > sep->se_maxcpm) { char pname[INET6_ADDRSTRLEN]; getnameinfo((struct sockaddr *)&rss, >Release-Note: >Audit-Trail: >Unformatted: