From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 7 04:22:39 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BE7B37B401 for ; Mon, 7 Jul 2003 04:22:39 -0700 (PDT) Received: from paris.ensmp.fr (paris.ensmp.fr [194.214.158.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8264143F85 for ; Mon, 7 Jul 2003 04:22:38 -0700 (PDT) (envelope-from Jose-Marcio.Martins@ensmp.fr) Received: from ensmp.fr (calloway [194.214.158.171])h67BMYpV013351; Mon, 7 Jul 2003 13:22:34 +0200 (MEST) Sender: Jose-Marcio.Martins@ensmp.fr Message-ID: <3F0957FA.F085B828@ensmp.fr> Date: Mon, 07 Jul 2003 13:22:34 +0200 From: Jose Marcio Martins da Cruz Organization: Ecole des Mines de Paris X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.9 sun4u) X-Accept-Language: fr, en MIME-Version: 1.0 To: freebsd-bugs@FreeBSD.ORG Content-Type: multipart/mixed; boundary="------------28E27EBD6E648498D81F8866" X-Miltered: at paris by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! cc: Claus Assmann Subject: Bug at inetd.c source file. 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: Mon, 07 Jul 2003 11:22:39 -0000 This is a multi-part message in MIME format. --------------28E27EBD6E648498D81F8866 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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). You'll find attached to this message a patch to change source file. 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 --------------28E27EBD6E648498D81F8866 Content-Type: text/plain; charset=us-ascii; name="inetd.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="inetd.c.patch" --- 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, --------------28E27EBD6E648498D81F8866--