[PATCH] core:PXELINUX: fix the OACK option parsing bug.

Liu Aleaxander
2009-08-08T08:05:08Z

the current code can just handle one option beacuse I put the do-while loop
in the wrong position.

Signed-off-by: Liu Aleaxander <Aleaxander at gmail.com>
---
 core/pxe.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/core/pxe.c b/core/pxe.c
index 81d3e23..bda1a54 100644
--- a/core/pxe.c
+++ b/core/pxe.c
@@ -928,20 +928,20 @@ static void pxe_searchdir(char *filename, struct file
*file)
         if (*options == 0)
             goto done;

-        dst = src = options;
-        while (buffersize--) {
-            if (*src == 0)
-                break;          /* found a final null */
-            *dst++ = *src++ | 0x20;
-            if (!buffersize)
-                goto done;  /* found no final null */
-        }
-
-        /*
-         * Parse option pointed to by options; guaranteed to be
null-terminated
-         */
-        p = options;
         do {
+            dst = src = options;
+            while (buffersize--) {
+                if (*src == 0)
+                    break;          /* found a final null */
+                *dst++ = *src++ | 0x20;
+                if (!buffersize)
+                    goto done;  /* found no final null */
+            }
+
+            /*
+             * Parse option pointed to by options; guaranteed to be
null-terminated
+             */
+            p = options;
             tftp_opt = tftp_options;
             for (i = 0; i < tftp_opts; i++) {
                 if (!strncmp(p, tftp_opt->str_ptr,tftp_opt->str_len))
--
1.5.6.rc0


--
regards
liu Aleaxander