Commit Graph

62 Commits (279f4cd5841f747c57d5de7c310c77fbba346ad4)

Author SHA1 Message Date
Martin Kojtal 755c6b8c2f
Merge pull request #10861 from pauluap/lwip_use_recursive_mutex
Make the sys_arch_protect() mutex be recursive.
2019-07-01 09:19:29 +01:00
Kimmo Vaisanen ff88a751f7 Fix netconn_recv_tcp_pbuf ARMC6 linker error
If "lwip.tcp-enabled" is set to false, ARMC6 compilation fails to error
Error: L6218E: Undefined symbol netconn_recv_tcp_pbuf

LWIP::socket_recv() is TCP socket specific method so implementation can be
enabled only when LWIP_TCP flag is set.
2019-06-27 14:18:07 +03:00
Martin Kojtal 4b438ac1de
Merge pull request #10834 from tymoteuszblochmobica/udp
Fixed UDP sendto if IP version not match
2019-06-25 11:03:03 +01:00
Paul Thompson 91402f4d77 Make the sys_arch_protect() mutex be recursive.
Fixes #9744

Appears to be a lwIP porting bug. Comments in our porting layer say:

    This function should support recursive calls from the same task or interrupt. In other words, sys_arch_protect() could be called while already protected.
2019-06-19 21:49:33 -07:00
Anna Bridge 5b0f45f685
Merge pull request #10807 from kjbracey-arm/lwip_tcp_pbuf
NSAPI/lwIP: Use netconn_recv_tcp_pbuf
2019-06-19 14:57:18 +01:00
Tymoteusz Bloch b272c5f149 Fixed LWIPStack socket_sendto member to fail if interface IP4/6 version differ from destination adress IP version 2019-06-19 14:03:48 +02:00
Kevin Bracey 3b178a08ef NSAPI/lwIP: Use netconn_recv_tcp_pbuf
Slight RAM+speed efficiency improvement - read the TCP implementation's
native pbufs, rather than forcing netconn_recv to generate netbuf
wrappers for us. Saves one small lwIP heap allocation per TCP packet
received.
2019-06-11 16:00:11 +03:00
Tymoteusz Bloch 4005c77f21 LWIP DNS servers setting/getting fixed. 2019-06-07 18:58:05 +02:00
Martin Kojtal f0696417c5
Merge pull request #10647 from tymoteuszblochmobica/coverity
Fix LWIP warning issues found by Coverity scan

lwip_dns.c in function: dns_add_interface_server
CID 1399051 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a maximum size argument of 6 bytes on destination array new_interface_server->interface_name of size 6 bytes might leave the destination string unterminated.
line 434 strncpy(new_interface_server->interface_name, interface_name, INTERFACE_NAME_MAX_SIZE);

lwip_ip4_frag.c in function: ip_reass_free_complete_datagram

CID 1373164 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 209 ip_reass_dequeue_datagram(ipr, prev);

lwip_ip4_frag.c in function: ip_reass

CID 1373163 (#1-2 of 2): Dereference after null check (FORWARD_NULL)38. var_deref_model: Passing null pointer ipr_prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 663 ip_reass_dequeue_datagram(ipr, ipr_prev);

lwip_api_msg.c in function: lwip_netconn_do_connected

CID 1373162 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)10. var_deref_model: Passing null pointer op_completed_sem to sys_sem_signal, which dereferences it. [show details]
line 1336 sys_sem_signal(op_completed_sem);
2019-06-03 08:41:53 +01:00
Kevin Bracey 2fbbd9d2ca Introduce Semaphore::acquire methods
Deprecate wait() in favour of acquire(), try_acquire(),
try_acquire_for() and try_acquire_until().

Brings Semaphore more into line with CMSIS-RTOS 2 (which uses "acquire"),
itself (as it has "release"), and other classes having "try", "try for"
and "try until".

Also steps away from vague "wait" term - the primary operation here is
to acquire the semaphore, and this will of course sleep.
2019-05-28 17:02:06 +03:00
Tymoteusz Bloch c1b72a71b5 Fixed LWIP warning issues found by Coverity scan 2019-05-23 18:53:44 +02:00
Martin Kojtal 06cf7871b9
Merge pull request #10602 from tymoteuszblochmobica/dns
Runtime DNS server addition implement
2019-05-22 08:51:54 +01:00
Martin Kojtal 02eaad45a4
Merge pull request #10476 from tymoteuszblochmobica/closetcp
LWIP TCP socket close - disconnecting fix
2019-05-21 09:34:45 +01:00
Tymoteusz Bloch cdd31a5fc7 Runtime DNS server addition implement 2019-05-20 14:21:25 +02:00
Andrew Chong 67f8e35201 This allows CPP application to use the functions from cc.h. 2019-05-20 13:32:58 +08:00
Martin Kojtal 1aa95c017b
Merge pull request #10456 from tymoteuszblochmobica/multihoming
LWIP 2.1.2 tcpip thread stack overflow fix.
2019-05-13 14:17:36 +01:00
Martin Kojtal 03cda262c3
Merge pull request #10500 from andrewc-arm/patch-2
This removes many const char* warnings related with LWIP_ASSERT()
2019-05-12 20:07:52 +01:00
Anna Bridge 97e1c9cbaf
Merge pull request #10287 from linlingao/pr10177
Enable MTS_DRAGONFLY_F411RE to register with Pelion
2019-05-10 16:21:46 +01:00
Tymoteusz Bloch 51610cc90c Fixed TCP connection close.
If TCP FSM is in ESTABLISHED state,  waits  for TCP close handshaking until TIME_WAIT
The purpose is to prevent eth/wifi driver stop and  FIN ACK corrupt.
This may happend if network interface disconnect follows immediately after socket_close.
2019-05-10 17:00:38 +02:00
Tymoteusz Bloch 461efaae0a LWIP 2.1.2 tcpip thread stack overflow fix.
Applied missing LWIP patch to PPP/utils.c
"Major Refactoring & extensions" commited on May 23, 201 by hasnainvirk
LWIP 2.1.2 tcpip thread stack is restored to 1200 bytes
2019-05-07 15:19:41 +02:00
Lin Gao 84b8517905 Increase tcpip thread size for MTS_DRAGONFLY_F411RE 2019-05-02 11:34:30 -05:00
Lin Gao 2c22f549e9 Add option to keep post_binary_hook and make it default. It can be disabled by setting it to null 2019-05-02 11:25:20 -05:00
Andrew Chong aba02273ea This removes many const char* warnings related with LWIP_ASSERT() 2019-04-27 22:47:00 +08:00
Andrew Chong 058f07452a
Allow application to override LWIP_RAW 2019-04-27 00:22:00 +09:00
Martin Kojtal 7392d51460
Merge pull request #10394 from kjbracey-arm/networking_warnings
Networking: Fix some ARMC6 warnings
2019-04-18 13:15:45 +01:00
Kevin Bracey 69c6cc341b Networking: Fix some ARMC6 warnings
Some int-versus-long and signed-versus-unsigned format string
mismatches, and missing `class` keyword.
2019-04-17 16:03:44 +03:00
Tymoteusz Bloch 42b5680697 Multihoming fixed according to new LWIP implementation. 2019-04-11 20:54:48 -05:00
Tymoteusz Bloch 1632cc9ee4 Initial version of LWIP 2.1.2 2019-04-11 20:54:48 -05:00
Tymoteusz Bloch 7d13b758cb L3IP input now use tcpip_input instead of ip_input 2019-04-10 17:49:04 +02:00
Tymoteusz Bloch 646c925d60 Fixed compilation error in LWIPStack class if lwip tcp is disabled. 2019-03-21 17:58:31 +01:00
Cruz Monrreal e697d3770d
Merge pull request #9935 from jarvte/lwip_timeout_bringup_link
Increased timeout for lwip waiting netif_is_link_up
2019-03-16 22:54:57 -05:00
Teppo Järvelin 5d04df7afc Fix lwip to compile if MBED_CONF_LWIP_DEBUG_ENABLED is defined
File features/lwipstack/lwip-sys/arch/cc.h fails to compile
with error: 'MBED_NORETURN' does not name a type.
Fix with adding correct include.
2019-03-05 12:19:25 +02:00
Teppo Järvelin 5680ce5f56 Increased timeout for lwip waiting netif_is_link_up
Cellular PPP connect fails too often if timeout is 15s so increased to 60 seconds.
Tested to be enough with BG96 and MTB_MTS_DRAGONFLY.
2019-03-05 12:08:35 +02:00
Martin Kojtal dbd92c746b
Merge pull request #9387 from tymoteuszblochmobica/Sockets
Multihoming initial release
2019-02-21 13:50:03 +01:00
Tymoteusz Bloch 49141376ee Multihoming initial release
Added Multihoming feature to LWIP (ability to use more than one network interfaces) for increasing networking reliability.
This involves:

    LWIP interface
    LWIP IP routing
    DNS storage
    Sockets (bind to interface name possibility)
    possibility to add non default network interface
    cellular middleware modifications if cellular connection is used
2019-02-19 17:39:46 +02:00
Ron Eldor c94b5861e4 Add mbedtls platform setup and teardown to modules
Add calls to `mbedtls_platform_setup()`
and `mbedtls_platform_teardown()` to all modules and tests using Mbed TLS.
2019-02-18 11:43:32 +02:00
Cruz Monrreal 695179bf21
Merge pull request #9471 from mtomczykmobica/ONME-3868
lwipstack: mem-size set to the to minimal working size with DTLS
2019-01-31 10:21:00 -06:00
Marcin Tomczyk 5e28c1eb56 ONME-3868, Modiefie mem-size parameter to minimal size that work with DTLS 2019-01-23 14:29:48 +01:00
Seppo Takalo 6c5b845517 Clarify asyncronous Networkinterface::connect() and disconnect() API
This is slight API change, as a new return code is introduced.
Intention is to properly support asyncronous drivers that might
not be able to get new operation into execution, therefore they
need to return BUSY.
2019-01-18 15:36:23 +02:00
Seppo Takalo f3bbd2b4dd Allow LwIP TCP retransmissions to be configured and tune those smaller.
Currently, LwIP segment retransmission time is 12, which is very long
time as each timeout doubles the retransmission timeout.
Make that to 6 as that is same what we use in Nanostack.
2019-01-02 19:05:16 +02:00
Tymoteusz Bloch fc88922845 L3IP Interface Implementation
LWIP L3IP interface initial implementatioon
2018-12-20 15:23:43 +01:00
Lu 1422379c24 Realtek-rtl8195am-Network Socket Updates
This PR addresses the issue of #8124.
It updates and enriches the wifi connection error type to adapt the Network Socket test plan requirement.
In the meantime, it increases the heap size that allows the transmission of larger packet size.

Description
1. Increase heap size in lwipstack\mbed_lib.json to fulfill bursty TCP and UDP transmission requirement.
2. Modify and enrich wifi connection error types in TARGET_AMEBA\RTWInterface.cpp to adapt the decision logic of the wifi test cases.
3. Add new static constants in TARGET_AMEBA\RTWInterface.h, including 'SSID_MAX_LENGTH', 'PASSPHRASE_MAX_LENGTH' and 'PASSPHRASE_MIN_LENGTH' to help verifying the validity of ssid and passphrase.

Pull request type
[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change
2018-12-18 17:18:32 +08:00
deepikabhavnani d5da9eb636 Resolved warning "call_in inherits implicit virtual" 2018-11-26 09:41:15 -06:00
Kari Haapalehto d828d2d279 Change error code from NSAPI_ERROR_PARAMETER to NSAPI_ERROR_NO_CONNECTION
in a case were there wasn't connection.
2018-11-23 11:54:34 +02:00
Qinghao Shi 1a25051f91 override default mem-size in lwIP stack config 2018-11-16 10:27:15 +00:00
Mahesh Mahadevan 12c6b1bd88 MIMXRT1050EVK: Add ENET support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-11-14 07:13:07 -06:00
Martin Kojtal 41c1901318 lwipstack: fix astyle coding style 2018-11-07 08:56:35 +00:00
Jeroen de Bruijn 3f635ef813
fix: Update thread names
Remove _thread suffix and rename threads.
2018-11-02 13:44:24 +01:00
Jeroen de Bruijn 1f4f623339
feat: Name PPP thread 2018-11-01 13:57:03 +01:00
Kevin Bracey ea16a6ba1d Add MBED_NORETURN attributes
Save some ROM space by putting MBED_NORETURN attributes on error
functions and failed asserts.

mbed_error was documented as returning an error code. It never
actually could return, so documentation updated, but return type
kept.
2018-10-29 13:58:06 +02:00