goldsimon
deaa6e9406
Improved DNS_LOCAL_HOSTLIST interface (bug #50325 )
2017-02-17 10:08:49 +01:00
Axel Lin
be7ae5e36b
dns: Slightly improve dns_alloc_random_port implementation
...
Having the variable namining ret for a pointer makes the code looks odd,
ret looks like a value variable. Rename ret to pcb.
Also simplify the code in the do {} while() loop.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-02-04 18:42:14 +01:00
Axel Lin
3e30dbc75c
dns: Clean up unneeded #if guard for DNS_LOCAL_HOSTLIST/DNS_LOOKUP_LOCAL_EXTERN
...
This is a leftover of commit e77e18f8c410 "Worked on IPv6-only stack", fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-02-03 08:57:44 +01:00
goldsimon
5774fdfe75
dns: added one-shot multicast DNS queries
2016-12-09 09:20:46 +01:00
goldsimon
c87855423c
DNS: added compile-time check for some defines to fit into an u8_t (bug #49658 )
2016-12-07 09:09:45 +01:00
Dirk Ziegelmeier
1687721600
Fix compile when IPv4 is disabled
2016-12-05 22:01:58 +01:00
sg
03a9aac157
dns_enqueue(): minor readability improvement: add local variable "age" to store result of subtraction
2016-11-22 21:34:12 +01:00
Dirk Ziegelmeier
f6e27940bd
Make lwIP compile with clang -Wdocumentation -> several documentation fixes
2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
13fb616bb2
Cleanup hton*/ntoh* function handling and platform abstraction
...
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
2016-10-06 12:55:57 +02:00
Dirk Ziegelmeier
1f68b32485
Cleanup handling of non-standard functions in lwIP
...
- itoa
- strnicmp, stricmp/strcasecmp
- strnstr
Related to patch #9115 : httpd.c: strcasecmp for GCC and stricmp for Windows
2016-09-28 21:52:11 +02:00
Dirk Ziegelmeier
633696c153
Implement consistent IPx_ADDR_ANYx macro naming between IPv4 and IPv6
...
- rename IP4_ADDR_ANY to IP4_ADDR_ANY4
- IP4_ADDR_ANY (= IP_ADDR_ANY) is now IPv4 any address in ip_addr_t format
2016-09-28 12:56:57 +02:00
Axel Lin
f8a95aa27f
dns: Drop unnecessary txid variable in dns_check_entry
...
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-09-07 14:56:01 +02:00
sg
23147b0e21
added more out of range checks to dns_recv() (see bug #48924 )
2016-08-30 22:18:10 +02:00
Dirk Ziegelmeier
840d1e60fa
Fix bug #48924 : Potential out of bound reads in DNS codes of lwip project by adding checks for pbuf_copy_partial() return values.
...
Add some comments to clarify handling of untrusted network data handling.
2016-08-30 21:09:24 +02:00
goldsimon
9725a496b5
moved 2 enums from 'prot' headers to where they belong (dns, dhcp)
2016-08-19 09:41:33 +02:00
Dirk Ziegelmeier
0c7a59b5db
Minor: Documentation fixes
2016-08-18 11:06:50 +02:00
Dirk Ziegelmeier
5493220c93
Move DNS protocol structs to separate header. Needed for Erik Ekman's MDNS implementation.
2016-08-13 09:05:28 +02:00
Dirk Ziegelmeier
6dcb2b2415
Work on bug #48730 : Enums should be used instead of multiple defines (where applicable)
2016-08-12 22:51:43 +02:00
Dirk Ziegelmeier
ccc830c99c
Work on lwIP documentation
2016-07-27 13:03:36 +02:00
Dirk Ziegelmeier
8a9de94b1f
Restructure documentation. Create two top-level sections for thread-safe and callback-style APIs.
2016-07-26 18:39:53 +02:00
Dirk Ziegelmeier
9c10daba93
Document netif API in doxygen module style
2016-07-26 17:53:07 +02:00
Dirk Ziegelmeier
bd79f6c055
Document DNS, memory pools and PBUFs as modules
2016-07-26 16:40:13 +02:00
goldsimon
811b237bd7
dns: fixed declaration and usage of DNS_LOOKUP_LOCAL_EXTERN()
2016-07-07 13:02:47 +02:00
goldsimon
2fdea8b79b
fixed bug #48398 (dns: entries reused during found-callback could be aborted if ttl==0)
2016-07-04 13:55:20 +02:00
goldsimon
fd83f4fb22
Fix bug #48359 (dns entries are not set to state DONE)
2016-07-04 10:22:20 +02:00
Dirk Ziegelmeier
5e7b343d52
Fix dns_getserver to return a pointer, not a value
2016-06-13 09:00:46 +02:00
Dirk Ziegelmeier
90a656ed78
Fix several doxygen errors all over the code
2016-05-23 21:18:16 +02:00
Axel Lin
8c0f620d83
dns: Use LWIP_ARRAYSIZE instead of open coded
...
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-05-11 12:20:15 +02:00
Dirk Ziegelmeier
309e072238
Create new IP_IS_V4 macros and use them at instead of !IP_IS_V6 - since we now have an IPADDR_ANY_TYPE, just checking for !V6 does not mean it is V4
2016-04-06 22:31:31 +02:00
sg
a1c78ea7bf
ignore dns response parsing errors, only abort resolving for correct responses or error responses from correct server (bug #47459 )
2016-03-22 07:22:17 +01:00
Dirk Ziegelmeier
f3b7bca3cf
Fix bug #47370 : Port DNS client to IPv6
2016-03-09 19:25:06 +01:00
sg
5cf802eda0
dns_gethostbyname: return error code if no valid server is set instead of calling the 'found' callback in this case (fixes bug #46887 )
2016-03-07 19:47:39 +01:00
Dirk Ziegelmeier
288b4564e4
DNS: Fix potential array out of bounds access. Variable nanswers may contain bogus values. (found by Coverity)
2016-02-10 20:41:31 +01:00
Dirk Ziegelmeier
70487a43d4
Apply patch #8854 : dns: Simplify #ifdef guard around dns_gethostbyname_addrtype from Axel Lin
...
+ Minor compile fix from me
Patch makes the code a tiny bit less lightweight (add a parameter in dns_gethostbyname which is then not used in dns_gethostbyname_addrtype) but it makes the code more readable.
2016-01-13 19:52:08 +01:00
Axel Lin
6e863ecb50
dns: Remove always true test in dns_alloc_random_port
...
The only way to exit the do-while loop is err != ERR_USE.
Thus get rid of the always true test.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:37:26 +01:00
Axel Lin
668d461104
dns: Fix dns_alloc_pcb for reuse an existing one case
...
The logic to use an already existing pcb is wrong because the idx never
advanced in the for loop, so it keep checking the same dns_pcbs[idx] for
each loop iteration. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-16 09:09:31 +01:00
goldsimon
b401f42520
minor: fixed coding style (lwip style)
2015-10-07 10:03:12 +02:00
sg
2b971400fa
minor: coding style
2015-10-06 21:57:40 +02:00
sg
3312983b27
Make LWIP_DNS_SECURE and its possible values known in opt.h, remove default initialization of DNS server
2015-10-01 21:38:39 +02:00
goldsimon
f3ed562983
minor: removed superfluous comma after '}' in dns.c
2015-09-30 17:01:57 +02:00
goldsimon
373714c02f
dns: improved handling 2nd server if first failed
2015-09-30 14:22:39 +02:00
goldsimon
45fd622491
Fixed bug #46071 Logic error in line 1473 in dns.c
2015-09-30 13:36:13 +02:00
goldsimon
bc30899168
fixed compiler warnings where passing variable instance to ip_addr_isany
2015-09-28 07:56:52 +02:00
sg
4f9bcc5ecc
fixed compiler warnings reported by mingw-64
2015-09-17 22:00:16 +02:00
sg
9614c60cf6
fixed constness for DNS_LOCAL_HOSTLIST_IS_DYNAMIC
2015-09-17 21:32:11 +02:00
Dirk Ziegelmeier
f62022cdf3
Compiler warning fixes (mostly constness in dual-stack configurations)
2015-09-17 13:59:52 +02:00
goldsimon
726af89168
minor compiler warning fixes and coding style
2015-09-17 11:00:21 +02:00
Joel Cunningham
7276f49f54
Fix typos from task #12243
...
This fixes two typos spotted during visual inspection of changes related
to task #12243
2015-09-14 20:43:21 +02:00
sg
1e4f312352
fixed compiling DNS code again
2015-09-08 06:03:27 +02:00
sg
77270adb96
Changed dns_gethostbyname_addrtype() to always be a function, fixed code for C PP :-(
2015-09-07 22:33:10 +02:00