From owner-freebsd-bugs Fri Mar 2 17:20: 9 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 7BD9637B71A for ; Fri, 2 Mar 2001 17:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f231K1l53357; Fri, 2 Mar 2001 17:20:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 31D9A37B718 for ; Fri, 2 Mar 2001 17:11:17 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f231BH452359; Fri, 2 Mar 2001 17:11:17 -0800 (PST) (envelope-from nobody) Message-Id: <200103030111.f231BH452359@freefall.freebsd.org> Date: Fri, 2 Mar 2001 17:11:17 -0800 (PST) From: jbrowne@jbrowne.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/25502: TFTP in libstand(3) fails on all transactions after first failure Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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