This adds const to the sntp servername get/set API and internal storage
SNTP's usage of this name is read only and SNTP only passes it to dns_gethostbyname()
This was found by compiling with GCC -Wwrite-strings which makes the literal
SNTP_SERVER_ADDRESS a const string. This then produced warnings with sntp_init()'s
call to sntp_setservername()
lwip_isdigit/isxdigit/islower/isspace takes int as argument, so
explicitly cast to int to silence below build warnings.
src/core/ipv4/ip4_addr.c: In function 'ip4addr_aton':
src/core/ipv4/ip4_addr.c:160:5: warning: array subscript has type 'char' [-Wchar-subscripts]
if (!lwip_isdigit(c)) {
^
src/core/ipv4/ip4_addr.c:175:7: warning: array subscript has type 'char' [-Wchar-subscripts]
if (lwip_isdigit(c)) {
^
src/core/ipv4/ip4_addr.c:178:7: warning: array subscript has type 'char' [-Wchar-subscripts]
} else if (base == 16 && lwip_isxdigit(c)) {
^
src/core/ipv4/ip4_addr.c:179:9: warning: array subscript has type 'char' [-Wchar-subscripts]
val = (val << 4) | (u32_t)(c + 10 - (lwip_islower(c) ? 'a' : 'A'));
^
src/core/ipv4/ip4_addr.c:204:3: warning: array subscript has type 'char' [-Wchar-subscripts]
if (c != '\0' && !lwip_isspace(c)) {
^
Signed-off-by: Axel Lin <axel.lin@ingics.com>
portif = br->ports[dstport_idx].port_netif;
So no need to have NULL test for both br->ports[dstport_idx].port_netif
and portif.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
The version check is done in these functions, it should be ok to put
assert in the else clause.
Fix below build errors:
../../../../lwip/src/apps/snmp/snmp_msg.c: In function ‘snmp_version_enabled’:
../../../../lwip/src/apps/snmp/snmp_msg.c:87:1: error: embedding a directive within macro arguments is not portable [-Werror]
#if LWIP_SNMP_V3
^
../../../../lwip/src/apps/snmp/snmp_msg.c:89:1: error: embedding a directive within macro arguments is not portable [-Werror]
#endif
^
../../../../lwip/src/apps/snmp/snmp_msg.c: In function ‘snmp_version_enable’:
../../../../lwip/src/apps/snmp/snmp_msg.c:126:1: error: embedding a directive within macro arguments is not portable [-Werror]
#if LWIP_SNMP_V3
^
../../../../lwip/src/apps/snmp/snmp_msg.c:128:1: error: embedding a directive within macro arguments is not portable [-Werror]
#endif
^
cc1: all warnings being treated as errors
/home/axel/git/lwip/lwip-contrib/ports/unix/../Common.allports.mk:94:
recipe for target 'snmp_msg.o' failed
make: *** [snmp_msg.o] Error 1
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
This adds a new hook allowing an external DNS resolver to be hooked into
netconn_gethostbyname(). The hook can handle some or all of the queries
One use case for this hook is to run mDNSResponder in the same system as LwIP
(mDNSResponder also uses LwIP's socekt APIs) and have it handle .local queries
while LwIP stack handles unicast DNS queries
Include lwip/sys.h to fix below build error:
../../../../lwip/src/apps/httpd/httpd.c:470:23: error: implicit declaration of function ‘sys_now’ [-Werror=implicit-function-declaration]
u32_t ms_needed = sys_now() - hs->time_started;
^~~~~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com>
MSG_PEEK on TCP sockets was broken since commit b71d4477ea
from 06.03.2017: recv hung in an endless loop and tcp_recved() was called for peeked data
(which would result in a too large window advertised).
Aded TCP MSG_PEEK to socket unit tests
Use NETIF_FOREACH macro to get some optimizations for LWIP_SINGLE_NETIF case.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
We preserved the TIME_WAIT handling before, but it seems this is not correct: we want to issue
a RST later again if someone wants to talk to this port. With TIME_WAIT, this might not always
the case.
Slightly better readability by calling dns_backupserver_available()
instead of open-coded. Also move dns_backupserver_available() function
up to avoid forward declaration.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
- call conn->err() instead of conn->recv() if handshake fail and free conn
- close inner_conn and free current conn in altcp_mbedtls_close()
Signed-off-by: goldsimon <goldsimon@gmx.de>
Partly revert commit 0486100a2b from 07.08.2017 as it breaks layering: every layer must free its own altcp_pcb. Freeing the inner_conn is not the right way.