patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8692, Fix for assertion fails in dns.c...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8692: Fix for assertion fails in dns.c if no DNS server is configured

Submitter:  Sylvain Rochet <gradator>
Submitted:  Mon 22 Jun 2015 09:45:53 AM UTC
   
 
Category:  DNS Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Jump to the original submission

Wed 19 Aug 2015 11:13:36 PM UTC, comment #6: 

ppp_pcb->settings.usepeerdns = 0;  should already do the job

Sylvain Rochet <gradator>
Group Member
Tue 18 Aug 2015 07:31:51 PM UTC, comment #5: 

Fixed by checking in dns_send()

Simon Goldschmidt <goldsimon>
Group administrator
Tue 18 Aug 2015 07:01:01 PM UTC, comment #4: 

First, I think dns.c should work with ANY.

What PPP does is a different question. When thinking of a product including PPP, I guess a runtime configuration option to either enter a static server or to use the one provided by the remote PPP would be nice to have. I'm happy to leave it as it is now. Most products will have only PPP anyway so cannot use DNS while the link is down.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 22 Jun 2015 12:29:17 PM UTC, comment #3: 

Hello Jan,


On Mon, Jun 22, 2015 at 12:35:10PM +0200, Jan Breuer wrote:

> Hi Sylvain,
> your proposal is not a solution. Not for all cases.


Yes, I know ;-)


> I have discovered this behaviour also in common Ethernet network where the
> user can set all network parameters of the device including DNS. Setting
> DNS to 0.0.0.0 is still valid operation - disable DNS functionality at
> runtime - and all calls to dns_gethostbyname should return "not found". It
> don't mind, if we are in PPP, Ethernet with static address or we have
> address assigned by DHCP which does not tell us DNS server.


That's a very valuable input. I expected lwIP users (i.e. developers) to
never switch back to ANY for all DNS servers and I actually considered
what I did in PPP stack a mistake.

You are right, users of lwIP users (i.e. customers) might be able to set
up DNS server to NULL in order to configure their device to -never- try
name resolution, for example in a closed network without DNS support.

It pushes forward into applying Michael patch which consider all cases
instead of applying my patch to "fix" the PPP stack.


Sylvain

Sylvain Rochet <gradator>
Group Member
Mon 22 Jun 2015 10:09:49 AM UTC, comment #2: 

Added patch for my option.

Sylvain

(file #34289)

Sylvain Rochet <gradator>
Group Member
Mon 22 Jun 2015 09:46:14 AM UTC, comment #1: 

There is an other option, PPP could also switch back to
DNS_SERVER_ADDRESS, I'll let Simon decide :)

Indeed returning straight off if no DNS server is configured looks like
better from an overall design point of view, but who cares if uplink is
currently down ?  It might also help apps which are not designed with an
holdoff between tries which will then loop as fast as possible on DNS
request.

Sylvain

Sylvain Rochet <gradator>
Group Member
Mon 22 Jun 2015 09:45:53 AM UTC, original submission:  

From: Michael Waeber

If the ppp netif is shut down, e.g. because of a GPRS connection loss,
the DNS server address is set to the unspecified address (0.0.0.0) in
ppp.c cdns(). If a client application calls dns_gethostbyname() the
assertion in dns_send() is triggered:

>  LWIP_ASSERT("dns server has no IP address set",

!ip_addr_isany(&dns_servers[entry->server_idx]));

I think, if no DNS server is configured, dns_gethostbyname() should
succeed with "not found". Proposal patch attached.

Regards
Michael

Sylvain Rochet <gradator>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #34293:  dns.gitpatch added by gradator (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Updated the item)
  • -email is unavailable- added by gradator (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-18 goldsimon StatusIn Progress Done
        Open/ClosedOpen Closed
    2015-08-18 goldsimon StatusNone In Progress
        Assigned toNone goldsimon
    2015-08-05 goldsimon Assigned togoldsimon None
    2015-06-22 gradator Attached File#34288 Removed
    2015-06-22 gradator Attached File- Added dns.gitpatch, #34293
    2015-06-22 gradator Attached File- Added 0001-PPP-DNS-switch-back-to-DNS_SERVER_ADDRESS-for-first-.patch, #34289
    2015-06-22 gradator Attached File- Added dns.patch, #34288

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code