[Top][All Lists]

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

Re: [lwip-users] DHCP on multiple interfaces

From: address@hidden
Subject: Re: [lwip-users] DHCP on multiple interfaces
Date: Mon, 11 Mar 2019 21:01:25 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2

Am 11.03.2019 um 11:29 schrieb Toby Duckworth:
I am updating our code to support multiple simultaneous network interfaces,
and have a question relating to DHCP.

Before calling dhcp_start(...) we call netif_set_default(...) - Is this
strictly necessary?

These two are different things. DHCP assigns an address, netif_set_default() sets up the default route (the netif that is used when targeting addresses outside the subnet of any netif).

DHCP does not need a default route to work. Maybe your application needs it though.

If I remove the call to netif_set_default, then DHCP doesn't appear to work

That would really suprise me.

With the net_set_default(..) call in place, DHCP works correctly, but
(perhaps obviously) only on one interface at a time. Furthermore, having

No, not obviously.

obtained an IP address, we then go on to call netconn_new(...) to create a
Netconn on it, and find that unless netconn_bind_if(...) is called on the
created netconn, then subsequent attempts to DHCP on a different interface
cause problems for that netconn.

That sounds strange.

I would like to understand better the expected behaviour of LWIP with
respect to multiple network interfaces. and in particular how the DHCP
process is meant to work:

1) Is a call to netif_set_default(..) required before calling


2) Is it possible for multiple network interfaces to DHCP simultaneously?


3) Is a call to netconn_bind_if(...) necessary if we want to guarantee that
packets are sent and received using a particular network interface?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]