From owner-svn-src-all@FreeBSD.ORG Sun Jan 17 10:59:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB4D1065670; Sun, 17 Jan 2010 10:59:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440088FC1C; Sun, 17 Jan 2010 10:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HAx70s000171; Sun, 17 Jan 2010 10:59:07 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HAx7re000169; Sun, 17 Jan 2010 10:59:07 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001171059.o0HAx7re000169@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 17 Jan 2010 10:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202463 - stable/7/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 10:59:07 -0000 Author: gavin Date: Sun Jan 17 10:59:07 2010 New Revision: 202463 URL: http://svn.freebsd.org/changeset/base/202463 Log: Merge r201429 from head: Fix return code in the case of successful file transfer, broken in tftp.c 1.13 PR: bin/117452 Submitted by: Spencer Minear minear securecomputing.com Approved by: ed (mentor, implicit) Modified: stable/7/usr.bin/tftp/tftp.c Directory Properties: stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/usr.bin/tftp/tftp.c ============================================================================== --- stable/7/usr.bin/tftp/tftp.c Sun Jan 17 10:58:59 2010 (r202462) +++ stable/7/usr.bin/tftp/tftp.c Sun Jan 17 10:59:07 2010 (r202463) @@ -143,6 +143,7 @@ send_data: (struct sockaddr *)&peer, peer.ss_len); if (n != size + 4) { warn("sendto"); + txrx_error = 1; goto abort; } read_ahead(file, convert); @@ -156,6 +157,7 @@ send_data: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -163,6 +165,7 @@ send_data: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -205,7 +208,6 @@ abort: stopclock(); if (amount > 0) printstats("Sent", amount); - txrx_error = 1; } /* @@ -261,6 +263,7 @@ send_ack: peer.ss_len) != size) { alarm(0); warn("sendto"); + txrx_error = 1; goto abort; } write_behind(file, convert); @@ -274,6 +277,7 @@ send_ack: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -281,6 +285,7 @@ send_ack: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -331,7 +336,6 @@ abort: /* ok to ack, since user */ stopclock(); if (amount > 0) printstats("Received", amount); - txrx_error = 1; } static int