From owner-freebsd-net@FreeBSD.ORG Mon Dec 6 14:32:22 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 798CD16A4CE for ; Mon, 6 Dec 2004 14:32:22 +0000 (GMT) Received: from gatekeeper.syskonnect.de (gatekeeper.syskonnect.de [213.144.13.149]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7F5043D2F for ; Mon, 6 Dec 2004 14:32:21 +0000 (GMT) (envelope-from gheinig@syskonnect.de) Received: from syskonnect.de (skd.de [10.9.15.1])iB6EWjcx026085 for ; Mon, 6 Dec 2004 15:32:45 +0100 (MET) Received: from syskonnect.de (localhost [127.0.0.1]) by syskonnect.de (8.12.11/8.12.11) with ESMTP id iB6EWK8x008553 for ; Mon, 6 Dec 2004 15:32:20 +0100 (MET) Message-ID: <41B46D6D.7080702@syskonnect.de> Date: Mon, 06 Dec 2004 15:32:13 +0100 From: Gerald Heinig User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: ping counter overflow X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 14:32:22 -0000 Hi all, I've run into a possible bug in ping(8) while investigating a strange duplicate packet effect in our driver. The effect shows up on other drivers and I believe it's due to a counter overflow in ping. Basically, leave ping -f on a gigabit link for a few days (for medium to large values of "a few", ie. at least 3 or 4). Stop the ping and get lots of duplicate packets. I changed the 5 counter variables (nmissedmax, npackets, nreceived, nrepeats, ntransmitted) to short (from long) to reduce the time taken to overflow and managed to get the effect very easily - it takes about 3 seconds on a gigabit link. Changing these variables to their unsigned counterparts solved the problem. My question: shouldn't these counters be unsigned? (ie. unsigned long, instead of long) Regards, Gerald