From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 1 22:52:52 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC80716A41F for ; Thu, 1 Dec 2005 22:52:52 +0000 (GMT) (envelope-from omen@omenlabs.com) Received: from mail.dopp.net (mail.dopp.net [199.199.210.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C43543D46 for ; Thu, 1 Dec 2005 22:52:52 +0000 (GMT) (envelope-from omen@omenlabs.com) Received: from shell.dopp.net (shell.dopp.net [199.199.210.137]) by mail.dopp.net (Postfix) with ESMTP id 6042819282B for ; Thu, 1 Dec 2005 16:52:50 -0600 (CST) Received: by shell.dopp.net (Postfix, from userid 1002) id 45F20136EC8; Thu, 1 Dec 2005 16:52:50 -0600 (CST) Date: Thu, 1 Dec 2005 16:52:50 -0600 From: omen-pub@omenlabs.com To: freebsd-hackers@freebsd.org Message-ID: <20051201225250.GA73876@shell.dopp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Thu, 01 Dec 2005 22:53:51 +0000 Subject: [PATCH] bootparamd enhancement/fix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2005 22:52:53 -0000 Figured I'd throw this out to the list before filing a PR. http://www.omenlabs.com/freebsd/bootparamd.patch This patch is against 6.0-Release There are two issues with bootparamd that I ran into trying to get Solaris Jumpstart working nicely. One was permitting null hostnames. Certain options are passed to the jumpstart client using /etc/bootparams file entries like "term=:vt100". The current implementation only makes an exception for the file "dump=..." and will not return anything else if it can not be resolved. I have added in a check to return an address of 0.0.0.0 if the length of the hostname is zero. The second issue is a little more significant. If a router address is not supplied using the -r option, bootparamd uses the function get_myaddress(3) to determine the address of the host. The bootparamd(8) man page states: -r router The default router (a machine or an IP-address). This defaults to the machine running the server. The function get_myaddress always returns INADDR_LOOPBACK. This qualify as a bug. Using -r solves this problem, unless you are running on multiple networks. The patch attempts to make rpc.bootparamd more intelligent. If -r is not supplied, the ip address of the client is checked against all configured network interfaces on the host in the function myaddr. If the client is on a local subnet, the ip address of the server on that network is returned (if not, INADDR_LOOPBACK). This allows for whoami on multiple networks. John