Commit Graph

30 Commits (mbed-os-5.2)

Author SHA1 Message Date
Tony Wu 82df0e1181 lwip - Fix lwip_mac_address buffer overflow
Sounds serious, but should be benign.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2016-11-18 12:18:24 +00:00
Mahadevan Mahesh 0a134b851a K64F ENET: Update to remove unused variable. This is no longer available in the updated SDK ENET driver 2016-11-18 12:18:21 +00:00
Christopher Haster b724f0ca35 nsapi - Added test cases for gethostbyname
- test_dns_query
- test_dns_query_pref
- test_dns_literal
- test_dns_literal_pref
2016-11-18 12:18:07 +00:00
andreas.larsson 10cfea3bd8 Added emac_stack_mem_copy. Needed by the u-blox ODIN-W2 driver. 2016-11-08 10:45:01 +00:00
Christopher Haster e769c79ccc nsapi - Adopted standardized return types in lwip 2016-11-08 10:44:56 +00:00
Colin Hogben d484d573ab lwip: Expose principal socket limits as configuration parameters.
Allow the limits on numbers of sockets to be changed via the
configuration system.  The help texts show the RAM penalty from
increasing each value.
2016-11-08 10:44:02 +00:00
Colin Hogben 3eefc86cce lwip: Annotate with memory used by config parameters 2016-11-08 10:44:01 +00:00
Colin Hogben 9e25e1e07f lwip: Allow several configuration macros to be set externally.
Manually rebasing after the monster restructuring.
2016-11-08 10:43:59 +00:00
Christopher Haster 7efae2ebc9 lwip/nsapi - Cleaned up warnings in network code
- cc.h@57,1: "BYTE_ORDER" redefined
- lwip_inet_chksum.c@560,44: passing argument 1 of 'thumb2_checksum'
  discards 'const' qualifier from pointer target type
- lwip_pbuf.c@1172,9: variable 'err' set but not used
- SocketAddress.cpp@293,1: control reaches end of non-void function
2016-11-08 10:43:50 +00:00
Christopher Haster 5c97ea9254 lwip - Change k64f emac layer to drop frames on buffer exhaustion
Previously, exhausting hardware buffers would begin blocking the lwip
thread. This patch changes the emac layer to simply drop ethernet
frames, leaving recovery up to a higher level protocol.

This is consistent with the behaviour of the emac layer when unable
to allocate dynamic memory.
2016-11-08 10:43:42 +00:00
Christopher Haster 14f9518709 lwip - Fixed memory leak in k64f cyclic-buffer overflow
This was actually several bugs colluding together.

1. Confusion on the buffer-semaphore paradigm used led to misuse of the
tx semaphore and potential for odd behaviour.

2. Equality tests on tx_consume_index and tx_produce_index did not
handle overflow correctly. This would allow tx_consume_index to catch
up to tx_produce_index and trick the k64f_rx_reclaim function into
forgetting about a whole buffer of pbufs.

3. On top of all of that, the ENET_BUFFDESCRIPTOR_TX_READ_MASK was not
correctly read immediately after being set due to either a compiler
optimization or hardware delays. This caused k64f_low_level_output
to eagerly overrun existing buff-descriptors before they had been
completely sent. Adopting the counting-semaphore paradigm for 1 avoided
this concern.

As pointed out by @infinnovation, the overflow only occurs in the rare
case that the 120MHz CPU can actually generate packets faster than the
ENET hardware can transmit on a 100Mbps link.
2016-11-08 10:43:40 +00:00
Christopher Haster d36bda7d81 lwip - Added support for NSAPI_UNSPEC to lwip 2016-10-27 11:13:46 +01:00
Mika Leppänen 2794b48c38 Corrected lwip TCP socket accept ipv6 address conversion 2016-10-19 17:24:13 -05:00
adustm 899acb1627 ADD NEW TARGET : NUCLEO_F756ZG, based on existing NUCLEO_F746ZG 2016-10-14 16:15:44 -05:00
adustm 283a82f23e ADD NEW TARGET : NUCLEO_F439ZI, based on existing NUCLEO_F429ZI 2016-10-14 16:15:41 -05:00
Martin Kojtal 3a33de6577 lwip-interface: fix issue #2993
DEVICE_ are passed as command line -D, thus no inclusion is required.
``platform.h`` is C++ header file, should not be pulled in C files
2016-10-14 16:15:36 -05:00
cyliangtw 0b60434327 EMAC buffer address word alignment 2016-10-14 16:15:04 -05:00
cyliangtw faae13e650 remove warnings 2016-10-14 16:14:59 -05:00
Sam Grove 683d7b7d74 Merge pull request #2874 from 0xc0170/feature_wifi_ublox
emac HAL API, WiFiInterface additions
2016-10-04 22:46:09 -05:00
andreas.larsson 26eb5f19f2 Fixed mbed_lwip_get_netmask amd mbed_lwip_get_gateway 2016-10-04 16:40:15 +02:00
andreas.larsson f5675cc822 Increased the stack size for the lwIP thread from 1024 to 1200. Needed for the u-blox ODIN-W2 driver. The actually needed size has not been measured. 2016-10-04 15:52:56 +02:00
andreas.larsson b418fce8ac Added function for increasing ref count. 2016-10-04 15:52:55 +02:00
Bartek Szatkowski 1e7ba5fe79 Fix merge issues 2016-10-04 14:38:28 +01:00
Bartek Szatkowski ae11b51b26 Split lwip initialisation and interface bringup
Split IP stack initialisation from mbed_lwip_bringup to mbed_lwip_init.
2016-10-04 14:32:44 +01:00
Bartek Szatkowski 98eb50f592 Refactor lwip_stack function names to include mbed prefix
Mbed function names, prefixed with lwip are confusing, as the name
suggest that they are part of lwip ip stack.
2016-10-04 14:22:24 +01:00
Bartek Szatkowski d0be5733db EMAC: Fix LWIP_IPV4 and DEVICE_EMAC flag usage 2016-10-03 17:46:39 +01:00
andreas.larsson 1d3c63d9bb Changed name for the target UBLOX_C029 to UBLOX_EVK_ODIN_W2 2016-10-03 12:10:50 +02:00
Christopher Haster 5cd2d7869e Merge remote-tracking branch 'upstream/master' into feature_wifi_ublox_merge 2016-10-02 07:29:07 -05:00
Sam Grove 04a2af7395 Update net tests to use feature name LWIP and not IPv4 2016-10-01 02:21:04 -05:00
Christopher Haster ba99a1f31d restructure - Restructured features/net directory
features/net/network-socket -> features/netsocket
features/net/FEATURE_IPV4 -> features/FEATURE_LWIP
features/net/nanostack-binaries -> features/nanostack
features/net/FEATURE_NANOSTACK -> features/nanostack/FEATURE_NANOSTACK
2016-09-30 19:18:09 -05:00