From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 28 14:10:16 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5871D16A4DD for ; Sun, 28 Sep 2003 14:10:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE26D44001 for ; Sun, 28 Sep 2003 14:10:12 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h8SLACFY088301 for ; Sun, 28 Sep 2003 14:10:12 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h8SLAC8D088300; Sun, 28 Sep 2003 14:10:12 -0700 (PDT) (envelope-from gnats) Resent-Date: Sun, 28 Sep 2003 14:10:12 -0700 (PDT) Resent-Message-Id: <200309282110.h8SLAC8D088300@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Per Kristian Hove Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40E7116A4B3 for ; Sun, 28 Sep 2003 14:09:36 -0700 (PDT) Received: from abel.math.ntnu.no (abel.math.ntnu.no [129.241.15.50]) by mx1.FreeBSD.org (Postfix) with SMTP id E0A2544011 for ; Sun, 28 Sep 2003 14:09:33 -0700 (PDT) (envelope-from perhov@math.ntnu.no) Received: (qmail 17226 invoked from network); 28 Sep 2003 21:09:32 -0000 Received: from torx.math.ntnu.no (129.241.15.52) by abel.math.ntnu.no with QMQP; 28 Sep 2003 21:09:32 -0000 Message-Id: <20030928210932.74023.qmail@torx.math.ntnu.no> Date: 28 Sep 2003 21:09:32 -0000 From: Per Kristian Hove To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Per Kristian Hove Subject: kern/57328: [patch] -current loader uses wrong IP address for kernel and NFSROOT X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Per Kristian Hove List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 21:10:16 -0000 >Number: 57328 >Category: kern >Synopsis: [patch] -current loader uses wrong IP address for kernel and NFSROOT >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 28 14:10:12 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Per Kristian Hove >Release: FreeBSD 5.1-CURRENT sparc64 >Organization: >Environment: System: FreeBSD 5.1-CURRENT sparc64 >Description: When netbooting FreeBSD 5.1-CURRENT on sparc64, the loader tries to download the kernel and mount the NFS root file system from the wrong server address. This isn't noticeable unless you have separate DHCP, TFTP and NFS servers, but if you do, the loader tries to load the kernel and mount the root file system from the TFTP server. The problem doesn't seem to be sparc64-specific, it probably affects all non-PXE netbooting. >How-To-Repeat: Use a separate DHCP server (10.0.0.10), TFTP server (10.0.0.20) and NFS server (10.0.0.30). Put the following in dhcpd.conf: host hostname.example.com { [...] next-server 10.0.0.20; filename "loader"; option root-path "10.0.0.30:/export/install"; } Then netboot the sparc64 computer with "boot net:dhcp". The loader says: net_open: server addr: 10.0.0.20 net_open: server path: /export/install The first line should read net_open: server addr: 10.0.0.30 >Fix: Apply the following patch. Tested on: sparc64 buildworld (on i386 with TARGET_ARCH=sparc64). --- dev_net.c.diff begins here --- --- /sys/boot/common/dev_net.c.orig Tue Aug 26 01:30:41 2003 +++ /sys/boot/common/dev_net.c Sun Sep 28 22:41:47 2003 @@ -270,22 +270,21 @@ return (EIO); } exit: - printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - - /* - * If present, strip the server's address off of the rootpath - * before passing it along. This allows us to be compatible with - * the kernel's diskless (BOOTP_NFSROOT) booting conventions + /* + * Now that the loader loads the kernel via NFS, we should + * honor the IP address given in the rootpath. */ - - for(i=0; iRelease-Note: >Audit-Trail: >Unformatted: