Date: Sat, 27 Jan 2001 20:06:24 +0100 (CET) From: klaus@winf.htu.tuwien.ac.at To: FreeBSD-gnats-submit@freebsd.org Subject: bin/24683: obscure natd(8) error message Message-ID: <20010127190624.D0B565D6B@winf.htu.tuwien.ac.at>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010127190624.D0B565D6B>