Unbreak zfsloader with LOADER_TFTP_SUPPORT on

Only accept 'net' and 'pxe' devices as underlying transport
in tftp.c on x86. Prior to this change tftp code would attempt
to send packets over any boot device, including zfs one with
predictably sad results.

Approved by: re (gjb)
MFC After: 1 month
This commit is contained in:
Alexander Kabaev 2013-10-09 21:33:19 +00:00
parent 772f66457a
commit b13ba46dbf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=256244

View File

@ -400,10 +400,14 @@ tftp_open(const char *path, struct open_file *f)
struct iodesc *io;
int res;
#ifndef __i386__
if (strcmp(f->f_dev->dv_name, "net") != 0)
if (strcmp(f->f_dev->dv_name, "net") != 0) {
#ifdef __i386__
if (strcmp(f->f_dev->dv_name, "pxe") != 0)
return (EINVAL);
#else
return (EINVAL);
#endif
}
if (is_open)
return (EBUSY);