Bug 208669 - Improvement of pxeboot using Linux NFS servers.
Summary: Improvement of pxeboot using Linux NFS servers.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.2-STABLE
Hardware: i386 Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-04-10 12:00 UTC by Yoshiaki Suzuki
Modified: 2016-10-25 08:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshiaki Suzuki 2016-04-10 12:00:59 UTC
I tried to boot by pxeboot using some Linux nfs servers.

But, I could not  boot by using Linux nfs servers. 

I tested using CentOS6.7 and CentOS7.1 as a dhcp,tftp,NFS server.
The pxeboot of FreeBSD9.3 and 10.2 correctly downloaded by TFTP from Linux server.

At second stage , the pxeboot will mount to load kernel by nfs. But, pxeboot was failed to mount nfs.

I monitored a packet using tcpdump. It was as below.

14:12:47.658036 IP 192.168.8.215.1023 > 192.168.8.2.sunrpc: UDP,length 76
14:12:47.658349 IP 192.168.8.2.sunrpc > 192.168.8.215.1023: UDP,length 28
... reapeat infinity ....

I checked  a source file of pxeboot at FreeBSD 9.3, then I was succeed to boot using Linux NFS Server.

My improvement is as below.

*** /sys/boot/i386/libi386/pxe.c.orig  2014-12-14 13:47:38.000000000 +0900
--- /sys/boot/i386/libi386/pxe.c       2016-04-10 20:24:13.000000000 +0900
***************
*** 673,679 ****
        uh = (struct udphdr *) pkt - 1;
        bzero(udpread_p, sizeof(*udpread_p));

!       udpread_p->dest_ip        = h->myip.s_addr;
        udpread_p->d_port         = h->myport;
        udpread_p->buffer_size    = len;
        udpread_p->buffer.segment = VTOPSEG(data_buffer);
--- 673,679 ----
        uh = (struct udphdr *) pkt - 1;
        bzero(udpread_p, sizeof(*udpread_p));

!       udpread_p->src_ip         = h->destip.s_addr;
        udpread_p->d_port         = h->myport;
        udpread_p->buffer_size    = len;
        udpread_p->buffer.segment = VTOPSEG(data_buffer);

The Intel's document of pxe says 

DestIP: Only accept packets sent to this IP address. If this is zero,
packets sent to any IP address are accepted

http://www.intel.com/design/archives/wfm/downloads/pxespec.htm

I remove line of udpread_p->dest_ip... , And added the line udpread_p->src_ip... for security.

I wonder why NFS Server of FreeBSD is success at the code of current.
Unfortunately a reason isn't understood.


--- my test enviroment
Boot server
 CentOS6.7 and CentOS7.1.

Diskless client
 FreeBSD-9.3
 Hardware1: virtual machin of VMware ESXi 6.0
 Hardware2: M/B SuperMicro X8SIL-F (IntelPXE)