[Top][All Lists]

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

[lwip-devel] [bug #58571] DNS host list is global even for multiple neti

From: Ashley Duncan
Subject: [lwip-devel] [bug #58571] DNS host list is global even for multiple netifs
Date: Wed, 17 Jun 2020 16:43:00 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36

Follow-up Comment #2, bug #58571 (project lwip):

The netif is a PPP connection to a u-Blox W152 WiFi module.  When the PPP
connection is established to the module, it appears to negotiate a DNS address
and set it.  The DNS address is actually just the IP address of the module on
the PPP connection.  However, the module has no internet connection to the
outside world until you send it commands (on a UDP port over the PPP link) to
tell it to make the WiFi link.  Additionally the module is also a Bluetooth
device which is controlled over the same UDP port.  Sometimes we wish to only
use it for Bluetooth and never enable the WiFi.

So, to lwIP, the PPP connection appears as a valid outside world connection,
which is fair enough, but it is not.  In fact, while the WiFi link is not
enabled, the netif is set to link down.

But a DNS resolution on another netif still uses the DNS address supplied by
the PPP connection even though it is in link down state.  Because it was the
last netif to call dns_setserver.  But the DNS address is the local address of
the module on the PPP link, not an outside world address.

The other situation is when you have two netifs (e.g. ethernet and wifi), both
have gateways that have a preferred DNS address which is supplied upon DHCP
resolution, maybe even offering a local cache or service.  Should the
preferred DNS address not be used for each netif rather than just whatever the
last supplied was?

There appears to be no hooks or way to manage the receive of DNS addresses to
manage them yourself.  Auto assigning by DHCP can be disabled, but not by PPP.
  The received DNS address is not stored anywhere for later access, except
overwrites the global array (in dns_setserver). 

Without deep investigation, it seems to me that if dns_setserver took a netif
pointer and all reads of DNS addresses were through dns_getserver (rather than
direct array access) and had a netif pointer, and these functions could be
hooked or overridden.  Then you could manually manage your own DNS addresses.

In fact, it seems I have no option but to make this change in my situation?

Furthermore, there appears to be no way to manually set a DNS address without
risk of it being overwritten by DHCP or PPP.  

Hope that helps explain.




Reply to this item at:


  Message sent via Savannah

reply via email to

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