Bug 25502

Summary: TFTP in libstand(3) fails on all transactions after first failure
Product: Base System Reporter: jbrowne <jbrowne>
Component: miscAssignee: Mike Heffner <mikeh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jbrowne 2001-03-03 01:20:01 UTC
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.

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
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-06-30 00:24:58 UTC
State Changed
From-To: open->closed
Comment 2 Mike Heffner freebsd_committer freebsd_triage 2001-06-30 00:25:32 UTC
State Changed
From-To: closed->open

Meant to take ownership, not close. 


Comment 3 Mike Heffner freebsd_committer freebsd_triage 2001-06-30 00:25:32 UTC
Responsible Changed
From-To: freebsd-bugs->mikeh

Looks reasonable, I'll look it over more later.
Comment 4 Mike Heffner freebsd_committer freebsd_triage 2001-07-01 04:48:11 UTC
State Changed
From-To: open->analyzed

Committed, thanks! (MFC in 2 weeks)
Comment 5 Mike Heffner freebsd_committer freebsd_triage 2001-07-14 15:00:09 UTC
State Changed
From-To: analyzed->closed

Fix MFC'd.