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
correctly.
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
dhcp_start(..)?
No.
2) Is it possible for multiple network interfaces to DHCP simultaneously?
Yes.
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?
Yes!
Regards,
Simon
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users