Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Mar 2001 17:11:17 -0800 (PST)
From:      jbrowne@jbrowne.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/25502: TFTP in libstand(3) fails on all transactions after first failure
Message-ID:  <200103030111.f231BH452359@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         25502
>Category:       misc
>Synopsis:       TFTP in libstand(3) fails on all transactions after first failure
>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:   Fri Mar 02 17:20:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jim Browne
>Release:        4.2 RELEASE
>Organization:
>Environment:
FreeBSD XX.XX.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Wed Jan 17 19:10:29 PST 2001     root@XX.XX.com:/usr/src/sys/compile/GENERIC  i386

>Description:
When using the TFTP functionality in libstand(3), I noticed that all
TFTP transactions would fail after the first failure.  For example,
if you try to TFTP a file that does not exist, all subsequent TFTP
requests will fail with the same error.  A patch to fix is included
below.
>How-To-Repeat:

>Fix:
The problem is the fact that recvtftp() in tftp.c does not clear
errno.  All of the other clients of sendrecv() do so (e.g. ARP,
RPC, BOOTP, etc.).  It's not pretty, but it is how the other
protocols do it.

Here's a patch against 4.2 RELEASE:
 
bash-2.04$ grep \$FreeBSD /usr/src/lib/libstand/tftp.c
 * $FreeBSD: src/lib/libstand/tftp.c,v 1.2.6.2 2000/05/04 13:47:52 ps Exp $
bash-2.04$ diff -c2p /usr/src/lib/libstand/tftp.c /tmp/tftp.c
*** /usr/src/lib/libstand/tftp.c        Thu May  4 06:47:52 2000
--- /tmp/tftp.c Fri Mar  2 17:02:47 2001
*************** recvtftp(d, pkt, len, tleft)
*** 118,121 ****
--- 118,123 ----
        struct tftphdr *t;
  
+       errno = 0;
+ 
        len = readudp(d, pkt, len, tleft);

>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?200103030111.f231BH452359>