From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jul 2 18:00:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8093D1065670 for ; Wed, 2 Jul 2008 18:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5552C8FC13 for ; Wed, 2 Jul 2008 18:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m62I03r1069223 for ; Wed, 2 Jul 2008 18:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m62I030v069222; Wed, 2 Jul 2008 18:00:03 GMT (envelope-from gnats) Resent-Date: Wed, 2 Jul 2008 18:00:03 GMT Resent-Message-Id: <200807021800.m62I030v069222@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Seth Mos Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CC69106564A for ; Wed, 2 Jul 2008 17:59:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4018FC1C for ; Wed, 2 Jul 2008 17:59:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m62Hxbsj050008 for ; Wed, 2 Jul 2008 17:59:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m62HxbTi050007; Wed, 2 Jul 2008 17:59:37 GMT (envelope-from nobody) Message-Id: <200807021759.m62HxbTi050007@www.freebsd.org> Date: Wed, 2 Jul 2008 17:59:37 GMT From: Seth Mos To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/125192: net apinger port 0.6.1 marks all hosts as down X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2008 18:00:03 -0000 >Number: 125192 >Category: ports >Synopsis: net apinger port 0.6.1 marks all hosts as down >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 02 18:00:03 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Seth Mos >Release: RELENG_7_0 >Organization: pfSense >Environment: # uname -a FreeBSD lutjebroek.coltex.nl 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Tue Jul 1 01:34:41 EDT 2008 sullrich@builder7.bgn.pfsense.org:/usr/obj.pfSense/usr/src/sys/pfSense_wrap.7 i386 >Description: The pfSense projecting is currently integrating apinger into the pfSense product to monitor all gateways on the system. When starting apinger at sytem boot it will report all hosts as down. When killing and starting apinger again it will work about 1 out of every 4 tries. This is very frustrating as this results to incorrect rule generation for load balancing. When running apinger in debug mode using apinger -f -d -c /var/etc/apinger.conf it will reveal in the output "Alien reply received". This string comes from icmp.c in the apinger sources and is output when the icmp reply does not match the seq number on the sent ping. A tcpdump on the interface reveals that a icmp echo and reply are indeed received with the correct sequence numbers. After a quick investigation by Ermal Luci of the pfSense project it appears the ident is generated using the process id. The process id on FreeBSD can be larger then 16 bits which results in incorrect sequence numbers being used which results in triggering the error. A patch is attached to this PR which corrects it. Cursory testing and rebooting the aforementioned host indicates the problem does not exist any more and apinger correctly generates a status report. Kind regards, Seth Mos pfSense Developer >How-To-Repeat: Generate a apinger.conf configuration file. Then stop and start until apinger has a process id higher then 16 bits. >Fix: See attached patch. Patch attached with submission follows: --- main.c.org 2008-07-02 22:43:14.000000000 +0200 +++ main.c 2008-07-02 22:11:49.000000000 +0200 @@ -277,7 +277,7 @@ return 1; } - ident=getpid(); + ident=getpid() & 0xFFFF; signal(SIGTERM,signal_handler); signal(SIGINT,signal_handler); signal(SIGHUP,signal_handler); >Release-Note: >Audit-Trail: >Unformatted: