[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] lwip: Allocate the loopback netif by default
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] lwip: Allocate the loopback netif by default |
Date: |
Sat, 2 Dec 2023 19:40:33 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Applied, thanks!
Joan Lledó, le sam. 02 déc. 2023 11:14:01 +0100, a ecrit:
> From: Joan Lledó <jlledom@member.fsf.org>
>
> The translator received a null `netif_list` during initialization, this
> caused a few bugs.
>
> When started without parameters, the translator didn't add any new
> interface to `netif_list`, and that broke any subsequent fsysopts over
> the translator, as the stack was being initialized again instead of
> being reconfigured.
>
> DHCP was broken because the translator is usually installed without
> parameters, which are supposed to be added by the DHCP client through
> fsysopts.
>
> The absence of an allocated `netif_list` also prevented configuring a
> loopback interface.
>
> After these changes, starting the translator always allocates one
> interface and configures it as loopback.
> ---
> lwip/lwip-util.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/lwip/lwip-util.c b/lwip/lwip-util.c
> index fc4cb137..77d2c233 100644
> --- a/lwip/lwip-util.c
> +++ b/lwip/lwip-util.c
> @@ -149,13 +149,13 @@ init_ifs (void *arg)
> ip6_addr_t *address6;
> int i;
>
> - if (netif_list != 0)
> - {
> - if (netif_list->next == 0)
> - init_loopback ();
> - else
> - remove_ifs ();
> - }
> + if (netif_list == 0)
> + netif_list = calloc (1, sizeof (struct netif));
> +
> + if (netif_list->next == 0)
> + init_loopback ();
> + else
> + remove_ifs ();
>
> /*
> * Go through the list backwards. For LwIP
> --
> 2.40.1
>
>