diff options
author | kan <kan@FreeBSD.org> | 2013-10-09 21:33:19 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2013-10-09 21:33:19 +0000 |
commit | 0f43811dc1dabfd24fb8f72a4bb534361d96665f (patch) | |
tree | 3a49840589430568ee242146a3b4aceb8a67b698 /lib/libstand/tftp.c | |
parent | 4ab5163697ae354915222d0ef65a54ceebe7a0ee (diff) | |
download | FreeBSD-src-0f43811dc1dabfd24fb8f72a4bb534361d96665f.zip FreeBSD-src-0f43811dc1dabfd24fb8f72a4bb534361d96665f.tar.gz |
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
Diffstat (limited to 'lib/libstand/tftp.c')
-rw-r--r-- | lib/libstand/tftp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c index aa331b3..e3983c3 100644 --- a/lib/libstand/tftp.c +++ b/lib/libstand/tftp.c @@ -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); |