From b13ba46dbf266889b7fdad8b6dfbc0dfc667a971 Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Wed, 9 Oct 2013 21:33:19 +0000 Subject: [PATCH] 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 --- lib/libstand/tftp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c index aa331b3f6000..e3983c3af453 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);