From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 13 10:13:28 2006 Return-Path: X-Original-To: freebsd-bugs@freebsd.org 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 667CF16A4DD for ; Thu, 13 Jul 2006 10:13:28 +0000 (UTC) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zyadd226.zyxel.com.tw (zyadd226.zyxel.com.tw [61.222.65.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EB8743D45 for ; Thu, 13 Jul 2006 10:13:22 +0000 (GMT) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zytwbe01.zyxel.com ([172.23.5.10]) by smtp.zyxel.com.tw with InterScan Messaging Security Suite; Thu, 13 Jul 2006 18:20:40 +0800 Received: from zytwfe01.ZyXEL.com ([172.23.5.5]) by zytwbe01.zyxel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 13 Jul 2006 18:12:21 +0800 Received: from [172.23.17.43] ([172.23.17.43]) by zytwfe01.ZyXEL.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 13 Jul 2006 18:12:20 +0800 Message-ID: <44B61C86.1070504@zyxel.com.tw> Date: Thu, 13 Jul 2006 18:12:22 +0800 From: Blue User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-bugs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 13 Jul 2006 10:12:20.0631 (UTC) FILETIME=[D3C26270:01C6A664] Subject: [FreeBSD-6.1Release]bug in netstat? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2006 10:13:28 -0000 Hi, all: I have a few questions aout sidewaysintpr() in netstat\if.c. Why needs to allocate a list of struct iftot, and it's number is equal to the number of interfaces? I have traced the codes and found there's no special usage of the struct iftot list. Besides, the list of malloc space is never freed. Another problem is in line 667-669 for (off = firstifnet, ip = iftot; off && SLIST_NEXT(ip, chain) != NULL; ip = SLIST_NEXT(ip, chain)) { .................... } The codes above will not count in the last interface in the ifnet list. I think the statement should be: for (off = firstifnet, ip = iftot; off && ip; ip = SLIST_NEXT(ip, chain)) { .................... } Though the iftot list is supposed to be removed in my point of view. Could anyone give me any reason or hints? Best regards, blue