[syslinux] [PATCH] pxe: fix OACK packet handling
liu Aleaxander
aleaxander at gmail.com
Sat Aug 8 08:23:01 PDT 2009
Hi Sebastian
On Sat, Aug 8, 2009 at 11:10 PM, Sebastian Herbszt <herbszt at gmx.de> wrote:
> 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().
Well, in fact , the old code did convert all the options to low-case. And of
course yes, the strncasecmp will do work.
>
> [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;
> }
>
>
--
regards
liu Aleaxander
More information about the Syslinux
mailing list