pxe: allow TFTP server IP to be empty when not using TFTP
authorMichael Brown <mcb30@ipxe.org>
Mon, 28 Mar 2011 19:44:17 +0000 (20:44 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 28 Mar 2011 19:47:10 +0000 (20:47 +0100)
Reported-by: Marcus Grando <Marcus.Grando@corp.terra.com.br>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
core/fs/pxe/pxe.c

index aef2e7e..12bbdad 100644 (file)
@@ -754,9 +754,6 @@ static void __pxe_searchdir(const char *filename, struct file *file)
        break;
     }
 
-    if (!ip)
-       return;                 /* No server */
-
     buf++;                     /* Point *past* the final NULL */
     memcpy(buf, rrq_tail, sizeof rrq_tail);
     buf += sizeof rrq_tail;
@@ -792,6 +789,9 @@ static void __pxe_searchdir(const char *filename, struct file *file)
     }
 #endif /* GPXE */
 
+    if (!ip)
+           goto done;          /* No server */
+
     timeout_ptr = TimeoutTable;   /* Reset timeout */
     
 sendreq: