From owner-freebsd-net@FreeBSD.ORG Tue Nov 23 20:41:47 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E6F0106566B for ; Tue, 23 Nov 2010 20:41:47 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 3FEE38FC20 for ; Tue, 23 Nov 2010 20:41:47 +0000 (UTC) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id CAB9EBDC75 for ; Tue, 23 Nov 2010 12:41:46 -0800 (PST) To: freebsd-net@freebsd.org In-Reply-To: <20101123134254.GB36224@babolo.ru> Date: Tue, 23 Nov 2010 12:41:46 -0800 Message-ID: <45743.1290544906@tristatelogic.com> From: "Ronald F. Guilmette" Subject: Re: Implementing a trivial TFTP client? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 20:41:47 -0000 In message <20101123134254.GB36224@babolo.ru>, Aleksandr A Babaylov <.@babolo.ru> wrote: >rfg: >> My guess is that I'm doing multiple things in a substantially Wrong way. >> >> Any guidance would be appreciated. >Try >ktrace -i tftp >and look at >kdump >to see how it works Hay! Thanks for another great suggestion! I'm going to try that, just to see how a "normative" tftp client implementation does things, but actually, after I posted last night, I found the stupid programming error that was keeping my code from working (and now it is all working OK). Basically, in the tftp packet headers I had just forgotten to put the block number into proper network byte order. Once I fixed that silly programming error, my trivial tftp client worked perfectly. (You know, it's funny, I don't know what other people's experiences have been, but for me, in about 35 years of programming I've found that about 95% of all buugs in any code I've ever developed or worked on have been due to just silly small programming errors. It's very rare to see any program go haywire because of fundamental underlying conceptual problems. It's almost always just something small and silly.) Regards, rfg