[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [master] loader: parseCmdLineIp* takes just the value as an argument now.



> diff --git a/loader/loader.c b/loader/loader.c
> index 760c352..f2ec285 100644
> --- a/loader/loader.c
> +++ b/loader/loader.c
> @@ -821,17 +821,16 @@ static void readNetInfo(struct loaderData_s ** ld) {
>  */
>  static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
>  {
> +    char *start, *end;
> +    /* if there's "ip=" at the beginning, jump past it */
> +    if (!strncmp(argv, "ip=", 3)) {
> +        start = argv + 3;
> +    } else {
> +        start = argv;
> +    }
> +

You shouldn't need to check for ip= at the start, right?  This and the
ipv6 version are only ever called with the value itself, which should be
everything after the equals sign.

> @@ -876,15 +875,23 @@ static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
>   */
>  static void parseCmdLineIpv6(struct loaderData_s * loaderData, char *argv)
>  {
> +    char *start;
> +    /* if there's "ip=" at the beginning, jump past it */
> +    if (!strncmp(argv, "ip=", 3)) {
> +        start = argv + 3;
> +    } else {
> +        start = argv;
> +    }
> +

And regardless of the above, it's impossible to get into this function
with "ip=", since it's only called when "ipv6=" is a command line
option.

- Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]