Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Dec 2005 16:52:50 -0600
From:      omen-pub@omenlabs.com
To:        freebsd-hackers@freebsd.org
Subject:   [PATCH] bootparamd enhancement/fix
Message-ID:  <20051201225250.GA73876@shell.dopp.net>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051201225250.GA73876>