Bug 21743

Summary: pxeboot ignores NFS server IP address in root-path; libstand tweak
Product: Base System Reporter: Brian Candler <B.Candler>
Component: i386Assignee: ps
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Brian Candler 2000-10-04 10:10:01 UTC
pxeboot ignores the IP address component of the root-path, i.e.
    options root-path "10.0.0.1:/remoteroot";
                       ^^^^^^^^
and instead uses the DHCP server's IP address and tries to mount that.
Hence it is impossible to have one machine as DHCP/TFTP server and a
different machine as NFS server.

The kernel itself, with 'options BOOTP' and 'options BOOTP_NFSROOT', _does_
honour the NFS server IP address - so it's only a problem with pxeboot.

Fix: However this turns up another problem; there are two versions of
inet_addr, one in libstand/net.o and the other in libstand/inet_addr.o
(the problem being that inet_addr.o comes from libc/inet_addr.c and
references other libc things, so the link fails)

The solution is to remove libstand's reliance on libc, which I guess
is a hangover from olden times:



However, note that I haven't done a buildworld to check that this
doesn't affect anything else which uses libstand.--yngVV8ANSrT0tYdbyVH4GZBsqBoAZRbBbmqJUaIvTFrXdZi4
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- sys/boot/i386/libi386/pxe.c.orig    Sun Sep 10 02:52:18 2000
+++ sys/boot/i386/libi386/pxe.c Wed Oct  4 09:13:06 2000
@@ -292,6 +292,8 @@
                        if(rootpath[i] == ':')
                                break;
                if(i && i != FNAME_SIZE) {
+                       rootpath[i] = '\0';
+                       rootip.s_addr = inet_addr(&rootpath[0]);
                        i++;
                        bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1);
                        bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1);
How-To-Repeat: Set up DHCP and TFTP server on 10.0.0.200 with
  next-server 10.0.0.200;
  filename "pxeboot";
  option root-path "10.0.0.1:/os/freebsd-4.1";
Start up a DHCP/PXE machine. It reports:

  pxe_open: server addr: 10.0.0.200         <<< This should be 10.0.0.1
  pxe_open: server path: /os/freebsd-4.1
  pxe_open: gateway ip:  0.0.0.0
Comment 1 ps freebsd_committer freebsd_triage 2000-10-04 10:25:15 UTC
Responsible Changed
From-To: freebsd-bugs->ps

I'll take this
Comment 2 ps freebsd_committer freebsd_triage 2000-11-05 14:55:32 UTC
State Changed
From-To: open->closed

Committed.