[syslinux] [PATCH] pxe: fix OACK packet handling

Sebastian Herbszt herbszt at gmx.de
Sat Aug 8 08:10:06 PDT 2009


liu Aleaxander wrote:
> Yeah, this make the things much easier, but should we make sure the options are converted to low-case?
> Because the strings in the tftp_options are all in low-case, and I'm not sure the options are all transfromed in the 
> low-case.

The old code did only covert the first option tho. We can use strncasecmp() instead of strncmp().

[PATCH] pxe: compare option names case in-sensitive

Use strncasecmp() instead of strncmp().

Signed-off-by: Sebastian Herbszt <herbszt at gmx.de>

diff --git a/core/pxe.c b/core/pxe.c
index a4b8a14..30cf036 100644
--- a/core/pxe.c
+++ b/core/pxe.c
@@ -940,7 +940,7 @@ static void pxe_searchdir(char *filename, struct file *file)
         do {
             tftp_opt = tftp_options;
             for (i = 0; i < tftp_opts; i++) {
-                if (!strncmp(p, tftp_opt->str_ptr,tftp_opt->str_len)) {
+                if (!strncasecmp(p, tftp_opt->str_ptr,tftp_opt->str_len)) {
                     buffersize -= tftp_opt->str_len;
                     break;
                 }




More information about the Syslinux mailing list