Home | History | Annotate | Download | only in nfs
History log of /src/sys/nfs/nfs_bootdhcp.c
RevisionDateAuthorComments
 1.60  20-Oct-2024  mlelstv MBUFTRACE
 1.59  05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.58  13-May-2024  msaitoh branches: 1.58.2;
s/contigous/contiguous/ in comment.
 1.57  24-Dec-2022  andvar s/reqest/request/ in comment.
 1.56  10-Jun-2016  ozaki-r Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.55  21-May-2015  rtr change nfs_boot_sendrecv to take sockaddr_in * instead of mbuf *

fixes m_serv (single mbuf leak) leak in kern/subr_tftproot.c
 1.54  09-May-2015  rtr when calling nfs_boot_sendrecv pass NULL for pointers instead of 0
 1.53  27-Mar-2015  hikaru m_pullup() is called in rcvproc callback functions,
so nfs_boot_sendrecv() should keep track of the head of mbuf chain.
fixes kern/48746
 1.52  04-Oct-2010  cyber branches: 1.52.14; 1.52.18; 1.52.34; 1.52.36;
Add support to honor MTU settings from DHCP during netboot.

Defines IP_MIN_MTU as 576.

Glanced over quickly by martin@ and joerg@.
 1.51  10-Jul-2009  roy branches: 1.51.2; 1.51.4;
Use a function to add extra data to the vendor area so that data added
remains constant for both DISCOVER and REQUEST messages.
 1.50  10-Jul-2009  roy Protect against short IP addresses in the DHCP message.
 1.49  10-Jul-2009  roy When using DHCP, request the parameters that we need. Fixes PR kern/38830.
Thanks to Tim McIntosh.
 1.48  06-May-2009  cegger correct previous: use %zu for BOOTP_SIZE_(MIN,MAX).
Pointed out by David Holland
 1.47  05-May-2009  cegger buildfix: use %d for BOOTP_SIZE_(MIN,MAX).
Makes i386 ALL kernel build again.
 1.46  02-May-2009  manu - Silence warning when running with debug enabled
- Remind the administrator about the required DHCP option when some are
missing, instead of silently failing, you stupid computer!
 1.45  19-Nov-2008  ad branches: 1.45.4;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.44  27-Oct-2008  cegger change nfs boot behaviour to automatically try next boot method if boot information are incomplete to succeed.
That way, it is possible combine static and dhcp boot:
For example, to boot diskless you can specify the nfs-server and the rootpath statically. All other information will be taken via dhcp.

Patch has been presented on port-xen, tech-kern and tech-net:
http://mail-index.netbsd.org/port-xen/2008/10/24/msg004488.html
http://mail-index.netbsd.org/tech-kern/2008/10/24/msg003255.html
http://mail-index.netbsd.org/tech-net/2008/10/24/msg000864.html

No comments, no objections.
 1.43  24-Oct-2008  cegger branches: 1.43.2;
- ansify function definition
- de- __P
- u_int32_t -> uint32_t

No functional changes.
 1.42  06-Aug-2008  plunky Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core
 1.41  20-Jul-2008  uwe When doing pointer arithmetic to compute limit cast bootp to pointer
type of correct signedness. Caught by lint.
 1.40  09-May-2008  rumble branches: 1.40.2; 1.40.4;
Fix compilation with DEBUG_NFS_BOOT_DHCP and ssp.
 1.39  28-Apr-2008  martin branches: 1.39.2;
Remove clause 3 and 4 from TNF licenses
 1.38  24-Apr-2008  ad branches: 1.38.2;
Merge the socket locking patch:

- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
 1.37  20-Dec-2007  dyoung branches: 1.37.6; 1.37.8;
Constify.
 1.36  29-Aug-2007  dyoung branches: 1.36.8; 1.36.12;
Constify: LLADDR() -> CLLADDR().
 1.35  08-May-2007  manu branches: 1.35.2; 1.35.6; 1.35.8;
Fix buid (broken by a fix introduced in the wrong file...)
 1.34  08-May-2007  manu Add the TFTPROOT kernel option for TFTP'ing root RAMdisk at root mount time.
This allows working around situations where a kernel with embedded RAMdisk
cannot be booted by the bootloader because the RAMdisk is too big.
 1.33  04-Mar-2007  christos branches: 1.33.2; 1.33.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32  09-Nov-2006  yamt branches: 1.32.2; 1.32.4;
remove some __unused in function parameters.
 1.31  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.30  16-Mar-2006  christos branches: 1.30.10; 1.30.12;
Don't use DEBUG, add a new DEBUG_NFS_BOOT_DHCP variable to provide more
information. Print more information about what fails.
 1.29  11-Dec-2005  christos branches: 1.29.4; 1.29.6; 1.29.8; 1.29.10;
merge ktrace-lwp.
 1.28  26-Feb-2005  perry branches: 1.28.4;
nuke trailing whitespace
 1.27  22-May-2004  jonathan branches: 1.27.4; 1.27.6;
Eliminate several uses of `curproc' from the socket-layer code and from NFS.

Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize. Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
 1.26  06-May-2004  drochner remove duplicated snprintf(vci, ...)
 1.25  21-Apr-2004  itojun kill sprintf, use snprintf
 1.24  29-Jun-2003  fvdl branches: 1.24.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.23  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.22  26-Feb-2003  matt Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
 1.21  10-Jun-2002  drochner increase IP TTL for BOOTP/DHCP request packets to avoid dumb
routers dropping the packet
(seems to be a problem with Cisco and its "helper-address" feature;
a Cabletron SSR I tested with didn't have this problem)
 1.20  12-May-2002  simonb branches: 1.20.2;
In bootpcheck(), make sure we m_pullup() all the of bootp header that we
actually examine.
While here, toss out home-grown ofs() macro and use offsetof().
 1.19  20-Mar-2002  thorpej Add a NetBSD Vendor Class Identifier option as proposed on tech-net in
message <20020216172527.C23901@dr-evil.shagadelic.org>.
 1.18  10-Nov-2001  lukem add RCSIDs
 1.17  02-Jun-2001  kim branches: 1.17.2; 1.17.6;
It is misleading that the kernel outputs "DHCP server:" followed by
the value of "next-server" from the DHCP (or BOOTP) reply. This is
not the DHCP server's IP address (except by chance), so instead of
"server" make it print "next-server".
 1.16  05-Dec-2000  drochner branches: 1.16.2;
add a kernel configuration option to set the string passed in bp_file
in diskless BOOTP/DHCP configuration - good for booting different
userland versions depending on the kernel version
 1.15  28-May-2000  gmcgarry Allow nfs root over token ring. Closes PR6629.
 1.14  29-Mar-2000  simonb branches: 1.14.2;
Don't need to include <sys/conf.h> here.
 1.13  20-Jan-2000  enami If server name field is overloaded for other purpose, or it just contains
NULL string, don't use it as server name.
 1.12  07-May-1999  drochner branches: 1.12.2;
print diskless boot related IP addresses in dot notation
 1.11  21-Feb-1999  drochner branches: 1.11.4;
restructure the diskless NFS boot code to keep track of the used
interface and the address allocated, to roll everything back if the
mount fails:
-put an interface pointer into "struct nfs_diskless" to have it
available for cleanup, don't pass it around anymore where the
"struct nfs_diskless" is already passed
-add a "cleanup" function which shuts the interface down
-in the protocol-specific parts, either return with "everything
ready" or "completely shut down"
-use common functions for interface initialization and shutdown
-add a function to delete all routes associate to an interface
(why is this necessary and not done by ~IFF_UP?)
g/c diskless swap stuff
general cleanup
 1.10  12-Feb-1999  thorpej Fix printf format problems on Alpha.
 1.9  13-Sep-1998  christos Fix copyright spacing.
 1.8  09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.7  24-Apr-1998  drochner -catch zero and broadcast IP addresses sent by a DHCP server
-warn about them (and other invalid replies)
-print address of BOOTP/DHCP server for better problem tracking
-KNF
 1.6  01-Mar-1998  ross Sweep up some miscellaneous leftover lite2 integration shrapnel.
 1.5  12-Jan-1998  scottr Consolidate NFS_BOOT_* options into opt_nfs_boot.h
 1.4  11-Jan-1998  scottr Make NFS_BOOT_DHCP work as expected.
 1.3  09-Jan-1998  drochner Use interface type to select "hardware type" in bootp header.
 1.2  30-Sep-1997  drochner branches: 1.2.2;
Make this file deserve its name: add DHCP support, conditionalized
with NFS_BOOT_DHCP.
Don't increment xid between retries anymore, it is not required and
it increases the response time in case of a slow server.
Use common code with bootparam boot.
 1.1  29-Aug-1997  gwr branches: 1.1.2;
Add support for nfs_mountroot using BOOTP based on the contributions
of Tor Egge (closes PR kern/2351).
 1.1.2.3  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.2  01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1  29-Aug-1997  thorpej file nfs_bootdhcp.c was added on branch marc-pcmcia on 1997-09-01 21:02:54 +0000
 1.2.2.1  08-May-1998  mycroft Pull up 1.7, per request of drochner.
 1.11.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.12.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16.2.4  20-Jun-2002  nathanw Catch up to -current.
 1.16.2.3  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.16.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.17.6.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.17.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.2.1  20-Jun-2002  gehenna catch up with -current.
 1.24.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.24.2.2  03-Aug-2004  skrll Sync with HEAD
 1.24.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.27.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.4.1  29-Apr-2005  kent sync with -current
 1.28.4.4  21-Jan-2008  yamt sync with head
 1.28.4.3  03-Sep-2007  yamt sync with head.
 1.28.4.2  30-Dec-2006  yamt sync with head.
 1.28.4.1  21-Jun-2006  yamt sync with head.
 1.29.10.1  19-Apr-2006  elad sync with head.
 1.29.8.1  01-Apr-2006  yamt sync with head.
 1.29.6.1  22-Apr-2006  simonb Sync with head.
 1.29.4.1  09-Sep-2006  rpaulo sync with head
 1.30.12.2  10-Dec-2006  yamt sync with head.
 1.30.12.1  22-Oct-2006  yamt sync with head
 1.30.10.1  18-Nov-2006  ad Sync with head.
 1.32.4.2  17-May-2007  yamt sync with head.
 1.32.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.32.2.1  13-May-2007  jdc Pull up revisions 1.34-1.35 (requested by manu in ticket #635).

Add the TFTPROOT kernel option for TFTP'ing root RAMdisk at root mount time.
This allows working around situations where a kernel with embedded RAMdisk
cannot be booted by the bootloader because the RAMdisk is too big.

Fix build (broken by a fix introduced in the wrong file...)
 1.33.4.1  11-Jul-2007  mjf Sync with head.
 1.33.2.2  09-Oct-2007  ad Sync with head.
 1.33.2.1  08-Jun-2007  ad Sync with head.
 1.35.8.2  09-Jan-2008  matt sync with HEAD
 1.35.8.1  06-Nov-2007  matt sync with HEAD
 1.35.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.35.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.36.12.1  02-Jan-2008  bouyer Sync with HEAD
 1.36.8.1  26-Dec-2007  ad Sync with head.
 1.37.8.1  18-May-2008  yamt sync with head.
 1.37.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.37.6.2  28-Sep-2008  mjf Sync with HEAD.
 1.37.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.38.2.5  09-Oct-2010  yamt sync with head
 1.38.2.4  18-Jul-2009  yamt sync with head.
 1.38.2.3  16-May-2009  yamt sync with head
 1.38.2.2  04-May-2009  yamt sync with head.
 1.38.2.1  16-May-2008  yamt sync with head.
 1.39.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.39.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.4.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.40.4.1  19-Oct-2008  haad Sync with HEAD.
 1.40.2.1  28-Jul-2008  simonb Sync with head.
 1.43.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.45.4.2  23-Jul-2009  jym Sync with HEAD.
 1.45.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.51.4.1  05-Mar-2011  rmind sync with head
 1.51.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.52.36.3  09-Jul-2016  skrll Sync with HEAD
 1.52.36.2  06-Jun-2015  skrll Sync with HEAD
 1.52.36.1  06-Apr-2015  skrll Sync with HEAD
 1.52.34.1  06-Apr-2015  snj Pull up following revision(s) (requested by hikaru in ticket #656):
sys/kern/subr_tftproot.c: revision 1.14
sys/nfs/krpc_subr.c: revision 1.39
sys/nfs/nfs_boot.c: revision 1.82
sys/nfs/nfs_bootdhcp.c: revision 1.53
sys/nfs/nfsdiskless.h: revision 1.31
m_pullup() is called in rcvproc callback functions,
so nfs_boot_sendrecv() should keep track of the head of mbuf chain.
fixes kern/48746
 1.52.18.1  03-Dec-2017  jdolecek update from HEAD
 1.52.14.1  16-Apr-2015  msaitoh Pull up following revision(s) (requested by hikaru in ticket #1287):
sys/kern/subr_tftproot.c: revision 1.14 via patch
sys/nfs/nfsdiskless.h: revision 1.31
sys/nfs/nfs_boot.c: revision 1.82
sys/nfs/krpc_subr.c: revision 1.39
sys/nfs/nfs_bootdhcp.c: revision 1.53
m_pullup() is called in rcvproc callback functions,
so nfs_boot_sendrecv() should keep track of the head of mbuf chain.
fixes kern/48746
 1.58.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed