From owner-freebsd-net@FreeBSD.ORG Tue Jan 16 22:19:00 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C24216A412; Tue, 16 Jan 2007 22:19:00 +0000 (UTC) (envelope-from fenner@research.att.com) Received: from mail-red.research.att.com (mail-red.research.att.com [192.20.225.110]) by mx1.freebsd.org (Postfix) with ESMTP id 2704113C469; Tue, 16 Jan 2007 22:19:00 +0000 (UTC) (envelope-from fenner@research.att.com) Received: from bright.research.att.com (bright.research.att.com [135.207.20.189]) by mail-green.research.att.com (Postfix) with ESMTP id 34CB2867B; Tue, 16 Jan 2007 17:00:18 -0500 (EST) Received: (from fenner@localhost) by bright.research.att.com (8.13.1/8.12.10/Submit) id l0GM0FkG011595; Tue, 16 Jan 2007 14:00:15 -0800 From: Bill Fenner Message-Id: <200701162200.l0GM0FkG011595@bright.research.att.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: Randall Stewart References: <20070112163057.2a3ec8f0.rnsanchez@wait4.org> <45A807F8.7080603@FreeBSD.org> <45ACCFF4.4040709@cisco.com> Date: Tue, 16 Jan 2007 14:00:15 -0800 Versions: dmail (linux) 2.7/makemail 2.14 Cc: freebsd-net@freebsd.org, "Bruce M. Simpson" , Ricardo Nabinger Sanchez , hugme@hugme.org Subject: Re: Problem with port 0 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, 16 Jan 2007 22:19:00 -0000 I'd note that RFC 768 explicitly mentions this possibility: Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information. If not used, a value of zero is inserted. I think Hug is saying that since the boot loader is the only thing that's running on the box, it's got no reason to use a port number, so it's not used. Hug's error message: >with default tftp - Jan 12 09:37:55 dukeengi01 tftpd[80898]: connect: Can't >assign requested address is consistent with the following code from in_pcbconnect_setup(): if (sin->sin_port == 0) return (EADDRNOTAVAIL); which dates back to BSD 4.4 and before. This is probably not completely wrong, but it's not right in this particular case - tftpd should be able to connect a UDP socket to a remote port 0 in order to respond to this request. (FreeBSD definitely can't send from port 0, but that's OK because we don't want to.) Bill