lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Unhandled error condition in dns_send()


From: Simon Goldschmidt
Subject: Re: [lwip-devel] Unhandled error condition in dns_send()
Date: Mon, 17 May 2010 14:29:57 +0200

Done, thanks for the input.

Simon


Bjoern Doebel wrote:
> Hello,
> 
> I'm working on LWIP on a local research OS and stumbled across a case
> where DNS wasn't working. After some debugging I found out that I
> hadn't set a default route using netif_set_default().
> 
> During debugging I found that dns_send() in src/core/dns.c may return
> errors which are not checked at the function's call sites. Some
> information on these errors would at least have made life easier for
> me. I therefore currently have the following patch applied:
> 
> Index: src/core/dns.c
> ===================================================================
> RCS file: /sources/lwip/lwip/src/core/dns.c,v
> retrieving revision 1.45
> diff -u -r1.45 dns.c
> --- src/core/dns.c    16 May 2010 15:57:44 -0000      1.45
> +++ src/core/dns.c    17 May 2010 06:29:42 -0000
> @@ -635,6 +635,7 @@
>  static void
>  dns_check_entry(u8_t i)
>  {
> +  int err;
>    struct dns_table_entry *pEntry = &dns_table[i];
> 
>    LWIP_ASSERT("array index out of bounds", i < DNS_TABLE_SIZE);
> @@ -649,7 +650,9 @@
>        pEntry->retries = 0;
> 
>        /* send DNS packet for this entry */
> -      dns_send(pEntry->numdns, pEntry->name, i);
> +      err = dns_send(pEntry->numdns, pEntry->name, i);
> +      if (err)
> +        printf("Error in dns_send: %d\n", err);
>        break;
>      }
> 
> @@ -678,7 +681,9 @@
>          pEntry->tmr = pEntry->retries;
> 
>          /* send DNS packet for this entry */
> -        dns_send(pEntry->numdns, pEntry->name, i);
> +        err = dns_send(pEntry->numdns, pEntry->name, i);
> +        if (err)
> +          printf("Error in dns_send: %d\n", err);
>        }
>        break;
>      }
> 
> 
> Is this reasonable or are there more useful alternatives for error
> reporting?
> 
> Regards,
> Bjoern
> 
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-devel

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



reply via email to

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