Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/subr_tftproot.c
RevisionDateAuthorComments
 1.26  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.25  05-Dec-2020  thorpej branches: 1.25.24;
Remove unnecessary inclusion of <sys/timevar.h>
 1.24  07-Mar-2020  tnn branches: 1.24.4;
clean trailing whitespace
 1.23  20-Jan-2019  bad tftproot_getfile(): return E2BIG when bootfile is to long.

tftproot_getfile() must return something != 0 to indicate error when
the bootfile is to long.
error just got set to 0 when nfs_boot_setrecvtimo() was called.

found during code review. compile tested only.
 1.22  27-Oct-2018  mlelstv appease gcc
 1.21  08-Feb-2018  dholland branches: 1.21.2; 1.21.4;
Typos.
 1.20  07-Feb-2018  manu Fix md(4) double attachment in TFTPROOT option

The mdattach() call in tftproot_dhcpboot() has probably always been
useless, but it seems it became harmful, as it causes 7.1.1 to deadlock
during boot.
 1.19  31-Oct-2016  maxv branches: 1.19.8;
The mbuf is freed by the protocol even on error, so always NULL the pointer
instead of double-freeing it. Indirectly pointed out by Mootja.
 1.18  10-Jun-2016  ozaki-r branches: 1.18.2;
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.17  12-May-2016  ozaki-r Protect ifnet list with psz and psref

The change ensures that ifnet objects in the ifnet list aren't freed during
list iterations by using pserialize(9) and psref(9).

Note that the change adds a pslist(9) for ifnet but doesn't remove the
original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We
shouldn't use the original list in the kernel anymore.
 1.16  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.15  10-May-2015  rtr mtod mbuf to sockaddr * for so_send().
 1.14  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.13  26-Aug-2014  manu branches: 1.13.2;
Fix build with TFTPROOT option enabled
 1.12  01-Dec-2012  mbalmer branches: 1.12.12;
Fix misspelling: accommodate is a long enough word to have room for two 'c's
and two 'm's.
 1.11  27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.10  23-Aug-2009  manu branches: 1.10.12; 1.10.18; 1.10.22;
Back out previous change: do not skip the test on rootspec, but make it
a simple attempt instead of an authoritative answer. The failure of the
rootspec test could me machine-dependant. Thanks to martin@ for pointing
that out.
 1.9  21-Aug-2009  manu When netbooting, rootspec is now "md0a", and it has no chance to match
an interface name, so do not give it a try.
 1.8  18-Mar-2009  cegger bzero -> memset
 1.7  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5  24-Apr-2008  ad branches: 1.5.2; 1.5.10; 1.5.12; 1.5.16; 1.5.20;
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.4  04-Apr-2008  cegger branches: 1.4.2;
use device_xname() where appropriate
OK martin
 1.3  12-Feb-2008  joerg branches: 1.3.6;
Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
 1.2  02-Jan-2008  yamt use kmem_alloc instead of malloc.
 1.1  08-May-2007  manu branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.16; 1.1.18; 1.1.24; 1.1.30;
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.1.30.1  02-Jan-2008  bouyer Sync with HEAD
 1.1.24.1  18-Feb-2008  mjf Sync with HEAD.
 1.1.18.4  27-Feb-2008  yamt sync with head.
 1.1.18.3  21-Jan-2008  yamt sync with head
 1.1.18.2  03-Sep-2007  yamt sync with head.
 1.1.18.1  08-May-2007  yamt file subr_tftproot.c was added on branch yamt-lazymbuf on 2007-09-03 14:41:06 +0000
 1.1.16.2  23-Mar-2008  matt sync with HEAD
 1.1.16.1  09-Jan-2008  matt sync with HEAD
 1.1.8.2  11-Jul-2007  mjf Sync with head.
 1.1.8.1  08-May-2007  mjf file subr_tftproot.c was added on branch mjf-ufs-trans on 2007-07-11 20:10:07 +0000
 1.1.6.2  09-Jun-2007  ad Sync with head.
 1.1.6.1  08-May-2007  ad file subr_tftproot.c was added on branch vmlocking on 2007-06-09 21:37:27 +0000
 1.1.4.2  17-May-2007  yamt sync with head.
 1.1.4.1  08-May-2007  yamt file subr_tftproot.c was added on branch yamt-idlelwp on 2007-05-17 13:41:47 +0000
 1.1.2.2  13-May-2007  jdc Pull up revision 1.1 (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.
 1.1.2.1  08-May-2007  jdc file subr_tftproot.c was added on branch netbsd-4 on 2007-05-13 10:29:46 +0000
 1.3.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.4.2.1  18-May-2008  yamt sync with head.
 1.5.20.1  21-Apr-2010  matt sync to netbsd-5
 1.5.16.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.12.1  05-Sep-2009  bouyer Pull up following revision(s) (requested by manu in ticket #929):
sys/kern/subr_tftproot.c: revisions 1.9, 1.10
When netbooting, rootspec is now "md0a", and it has no chance to match
an interface name, so do not give it a try.
Back out previous change: do not skip the test on rootspec, but make it
a simple attempt instead of an authoritative answer. The failure of the
rootspec test could me machine-dependant. Thanks to martin@ for pointing
that out.
 1.5.10.1  28-Apr-2009  skrll Sync with HEAD.
 1.5.2.2  16-Sep-2009  yamt sync with head
 1.5.2.1  04-May-2009  yamt sync with head.
 1.10.22.3  03-Dec-2017  jdolecek update from HEAD
 1.10.22.2  25-Feb-2013  tls resync with head
 1.10.22.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.18.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.10.12.2  16-Jan-2013  yamt sync with (a bit old) head
 1.10.12.1  30-Oct-2012  yamt sync with head
 1.12.12.3  25-Feb-2018  snj Pull up following revision(s) (requested by manu in ticket #1573):
sys/kern/subr_tftproot.c: 1.20
Fix md(4) double attachment in TFTPROOT option
The mdattach() call in tftproot_dhcpboot() has probably always been
useless, but it seems it became harmful, as it causes 7.1.1 to deadlock
during boot.
 1.12.12.2  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.12.12.1  30-Aug-2014  martin Pull up following revision(s) (requested by manu in ticket #69):
sys/kern/subr_tftproot.c: revision 1.13
Fix build with TFTPROOT option enabled
 1.13.2.5  05-Dec-2016  skrll Sync with HEAD
 1.13.2.4  09-Jul-2016  skrll Sync with HEAD
 1.13.2.3  29-May-2016  skrll Sync with HEAD
 1.13.2.2  06-Jun-2015  skrll Sync with HEAD
 1.13.2.1  06-Apr-2015  skrll Sync with HEAD
 1.18.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.19.8.1  26-Feb-2018  snj Pull up following revision(s) (requested by manu in ticket #580):
sys/kern/subr_tftproot.c: 1.20
Fix md(4) double attachment in TFTPROOT option
The mdattach() call in tftproot_dhcpboot() has probably always been
useless, but it seems it became harmful, as it causes 7.1.1 to deadlock
during boot.
 1.21.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.21.4.1  10-Jun-2019  christos Sync with HEAD
 1.21.2.2  26-Jan-2019  pgoyette Sync with HEAD
 1.21.2.1  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.24.4.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.25.24.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed