]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r297323,r297324, r297325, r297326:
authorian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 31 May 2016 17:15:57 +0000 (17:15 +0000)
committerian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 31 May 2016 17:15:57 +0000 (17:15 +0000)
commit68f6165c748aac077050744d8e2453fd26686061
treeb9ec305bb2d3684c155f3ca23c82f63f68f9cf94
parentbdeb55648d428ccaee42de31532e2080c412351b
MFC r297323,r297324, r297325, r297326:

  Set only one default route for nfsroot mount, the one associated with the
  interface that will be used to mount the rootfs (and never a self-ip proxy
  arp route).  Made up of the following related changes...

  Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
  server (and not when it came from a fallback method such as the ROOTDEVNAME
  option).  This makes the code in bootpc_init() choose the first interface
  that provided a rootpath name.  Previously it was choosing the first
  interface that got an IP address, which could be on a different and
  potentially unreachable subnet than the server providing the rootfs.

  If the rootpath name actually does come from a fallback source, then the
  code continues to use the first interface in the list that got configured.
  Note that this wasn't directly reported in the PR cited below, but was
  discovered while working on that PR.

  Switch bootpc_adjust_interface() from returning int to void.  Its one caller
  doesn't check for errors, and all the errors that can happen result in it
  calling panic anyway, except for one that's really more of a warning (and
  is going to disappear on an upcoming commit anyway).

  Stop setting the default route to the IP of the interface itself when the
  bootp/dhcp server doesn't provide a router option.  Doing so prevents
  setting defaultrouter=<ip> in rc.conf (it fails because there's already
  a bogus default route installed by bootpc_init).

  When an admin wants to use this style of proxy arp on an interface, the
  proper mechanism is to set the "use-lease-addr-for-default-route" flag
  in the dhcp server config.  That causes the lease address to be delivered
  in the routers option, and the normal handling of the routers option will
  then install the self-ip as the default route.

  Do not try to install a default route for each interface found, because
  only the first one will actually work and all the others just result in
  errors (which would get printed but otherwise ignored).

  Instead, wait until we make a choice of which interface will be used to
  mount the rootfs, and install the default route associated with it (if any).
  After doing the md_mount() call to obtain the needed info, remove the
  default route again, and transcribe the route info into the nfs_diskless
  structure.  If the system eventually chooses to mount the nfs rootfs, the
  default route will be installed again when the nfs_diskless code
  re-initializes the interface.

PR: 187094

git-svn-id: svn://svn.freebsd.org/base/stable/10@301057 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/nfs/bootp_subr.c