From owner-freebsd-bugs Sat Jan 27 11:10:22 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C0F7937B401 for ; Sat, 27 Jan 2001 11:10:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0RJA4452286; Sat, 27 Jan 2001 11:10:04 -0800 (PST) (envelope-from gnats) Received: from winf.htu.tuwien.ac.at (winf.htu.tuwien.ac.at [128.131.95.2]) by hub.freebsd.org (Postfix) with ESMTP id CC84437B699 for ; Sat, 27 Jan 2001 11:06:26 -0800 (PST) Received: by winf.htu.tuwien.ac.at (Postfix, from userid 1001) id D0B565D6B; Sat, 27 Jan 2001 20:06:24 +0100 (CET) Message-Id: <20010127190624.D0B565D6B@winf.htu.tuwien.ac.at> Date: Sat, 27 Jan 2001 20:06:24 +0100 (CET) From: klaus@winf.htu.tuwien.ac.at Reply-To: klaus@winf.htu.tuwien.ac.at To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/24683: obscure natd(8) error message Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24683 >Category: bin >Synopsis: obscure natd(8) error message >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 27 11:10:04 PST 2001 >Closed-Date: >Last-Modified: >Originator: Klaus A. Brunner >Release: FreeBSD 4.2-STABLE i386 >Organization: HTU Wien, FS WInf >Environment: FreeBSD (any version?) running natd(8) >Description: There is a rather annoying problem with natd(8)'s error message "unable to write packet back (...)". This error message may occur when a host is down, or when a firewall rule prevents natd from completing a sendto(). The problem is not that this error message exists, but that it does not give *any* detail (_which_ packet, addresses?). The problem is frequently reported on -questions and other lists, and it's also been bugging me for a while because I just couldn't figure out what was happening from ipfw logs et al. >How-To-Repeat: (see description) One scenario where this seems to happen frequently is when you're running Samba and natd on the same box. >Fix: This simple patch makes the error message verbose enough to be useful: --- natd.c Sat Jan 27 19:48:30 2001 +++ /tmp/natd.c Sat Jan 27 19:38:50 2001 @@ -586,7 +586,7 @@ static void FlushPacketBuffer (int fd) { int wrote; - char msgBuf[80]; + char msgBuf[160]; /* * Put packet back for processing. */ @@ -616,7 +616,8 @@ } else { - sprintf (msgBuf, "failed to write packet back"); + sprintf (msgBuf, "failed to write packet back (%s)", + FormatPacket((struct ip*)packetBuf)); Warn (msgBuf); } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message