Commit graph

95 commits

Author SHA1 Message Date
Angus Gratton 04a2cefb26 lwip: Enable IPV6_ONLY option for UDP sockets (BSD & netconn)
* setsockopt(s, IPV6_ONLY, &one, sizeof(int)) will disable IPV6-only
  mode. Incoming/outgoing IPV4 packets are dropped.

* Otherwise, sockets bound to IPV6_ANY_ADDR can receive unicast packets
  for IPV4 or IPV6.

* sendto() a IPV6-mapped-IPV4 address on a UDP socket works correctly
  (not supported for RAW or TCP sockets.)

* getaddrinfo() option AI_V4MAPPED is implemented.

As well as extending support to TCP & RAW, there is some potential improvement
to dropping incoming packets - the drop happens a bit late in the process and
there is no "ICMP port unreachable" response sent.
2017-10-02 10:50:27 +11:00
Angus Gratton 961180617e lwip: Add IPV6 multicast group membership socket options
As described in RFC2133: IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS,
IPV6_MULTICAST_LOOP, IPV6_MULTICAST_LOOP, IPV6_DROP_MEMBERSHIP.
2017-10-02 10:50:27 +11:00
Liu Zhi Fu 05b0d567e5 example: add iperf example
Support iperf
2017-09-26 09:19:01 +08:00
Ivan Grokhotkov 868b0ce228 Merge branch 'bugfix/list_node_naming' into 'master'
Fix "list_node" name conflict in bluedroid & dhcp_server

See merge request !1216
2017-09-12 12:10:54 +08:00
Angus Gratton 73b3ae8a2d lwip: Use hardware RNG for LWIP_RAND(), use LWIP_RAND() for random port assignment 2017-09-07 16:32:05 +10:00
Angus Gratton 9471ce9135 dhcpserver: Move DHCP option names to a separate header
Avoids naming conflicts. Resolves TW13826.
2017-09-05 17:28:40 +10:00
Angus Gratton 1be6bf6790 dhcpserver: Move list_node to implementation not public interface
Was unused in the public interface.

Closes https://github.com/espressif/esp-idf/issues/948
2017-09-05 17:14:23 +10:00
devsaurus 92535158e7 components/lwip: Expose TCP_MSL in menuconfig.
Merges https://github.com/espressif/esp-idf/pull/783
2017-08-30 16:44:53 +10:00
Liu Zhi Fu 7b2f388abc lwip: Make UDP/TCP receive mail box configurable
Different application may require different TCP/UDP receiv mail box size,
so make them configurable.
2017-07-25 13:56:32 +08:00
Jiang Jiang Jian 4ec2abbf23 Merge branch 'feature/some_refactor_for_tcpip_adapter' into 'master'
tcpip_adapter: not remove netif when tcpip adapter is stopped

See merge request !943
2017-07-13 22:16:00 +08:00
Liu Zhi Fu d724cc23d2 tcpip_adapter: not free netif when tcpip adapter is stopped
When tcpip adapter is stop, don't free the netif
2017-07-13 18:42:45 +08:00
XiaXiaotian 7a64e19ba8 Broadcast IP route based on source IP address.
If destination IP address of the packet is broadcast address, firstly compare
    source IP address with the that of each network interface. If it matches,
    packet is forwarded from the interface.
2017-06-30 16:18:29 +08:00
Angus Gratton 857a7f186e lwip: Make LWIP_ERROR behave as if assertions were off, even if they are on 2017-06-27 18:36:54 +10:00
Angus Gratton f5e7f2bb8f lwip: Remove port-specific sys_arch_assert(), use libc __assert_func() instead 2017-06-27 17:32:17 +10:00
Angus Gratton 8f4fc209a1 lwip: Enable LWIP assertions unless they are disabled globally 2017-06-23 16:26:11 +10:00
Angus Gratton 1c6510ed96 lwip: Allow configuring/disabling some TCP options to save RAM
RAM savings are small, but may add up when running large numbers of sockets.
2017-06-23 16:26:11 +10:00
Angus Gratton 1ea0ddb025 lwip: Expose broadcast/multicast ping enable options in menuconfig 2017-06-23 16:15:00 +10:00
Liu Zhi Fu 5cf3b1c201 esp32/lwip: adjust some lwip options and update wifi lib
1. Modify TCP TX window from 2 to 4
2. Modify TCPIP task stack default size from 2048 to 2560
3. Update wifi lib for TCP performance optimization
2017-04-28 15:25:33 +08:00
Jiang Jiang Jian 3f4e917ad6 Merge branch 'feature/ppp_over_serial' into 'master'
Enable experimental/unsupported PPP over Serial driver

From PR #272 https://github.com/espressif/esp-idf/pull/272

See merge request !690
2017-04-25 14:02:55 +08:00
Adrian Muzyka 47c722d674 Enable lwip PPPoS support
* Fix some lwip api bugs
 * Added PPP_SUPPORT parameter to lwip Kconfig
 * Added example pppos_client

Merges #272 https://github.com/espressif/esp-idf/pull/272
2017-04-21 14:23:34 +10:00
Liu Zhi Fu ab37f89f55 lwip: fix tcp stable test abort issue
1. Modify dhcp server timer to 1 seconds
2. Enable ETHARP_TRUST_IP_MAC

modify according to review
2017-04-19 17:39:32 +08:00
Ivan Grokhotkov 378884660a Merge branch 'feature/tw11250_add_tcp_delay_statistics' into 'master'
lwip: refactor to esp specific counter

1. Add tcp debug counter
2. Refactor other ESP specific counter

See merge request !635
2017-04-13 15:29:36 +08:00
Edmund Huber eab6d483a5 give the AP and STA netifs different names for ease of debugging lwip 2017-04-11 20:40:36 +08:00
Liu Zhi Fu ece61944f4 lwip: refractor to esp specific counter
1. Add tcp debug counter
2. Refractor other ESP specific counter
2017-04-10 14:46:48 +08:00
Ivan Grokhotkov 7754647e71 Merge branch 'bugfix/separate_ethernet_and_wifi' into 'master'
Allow separate ethernet & wifi configuration

If only 1/2 of ethernet & WiFi are enabled in config, the other interface is no longer linked into the firmware.

* Fixes bug where enabling Ethernet but not WiFi would fail to compile.
* Also means that enabling WiFi but not Ethernet no longer links some unused ethernet interface functions.


See merge request !525
2017-03-03 11:53:32 +08:00
Liu Zhi Fu 66199b1efe Check DHCP rebind timer before checking dhcp release timer in cause they have the same value.
lwip: modify dhcp timer granularity from 60s to 1s

Current DHCP granularity is 60 seconds, it's not accurate, it can cause DHCP release/rebind/renew timer
timeout at the same time, also it may renew/rebind/release at wrong time, thus cause problem.
2017-03-01 20:50:58 +08:00
Angus Gratton eb1fbaabce lwip: Refactor support for L2 pbuf free notification into each driver
Makes it easier to handle different drivers enabled at compile/link time.
2017-02-24 14:45:17 +11:00
qiyueixa 03e3b137bf lwip: optimize the dhcp client
1. modify the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s.
2. add DHCP_DOES_ARP_CHECK to menuconfig for users to specify if do a ARP check on the offered address.
   If enable, one more second will be taken in obtaining IP address.
3. update wifi libs
2017-01-23 13:44:34 +08:00
Wu Jian Gang 3c8235d40d lwip: Allow config TCP_MAXRTX & TCP_SYNMAXRTX in menuconfig 2017-01-17 17:44:25 +08:00
Liu Han 6c86586e97 components/lwip: Set the ping target info
Add API for set the ping target info and get the ping result
2017-01-11 10:58:34 +08:00
Ivan Grokhotkov 0efaa4f4b8 Merge branch 'feature/lwip-rcvbuf-option' into 'master'
add menuconfig option to enable SO_RCVBUF

This option is required by Arduino and enables netconn connection to be queried for amount of data available in the rx buffer.

See merge request !372
2017-01-07 18:45:37 +08:00
Wu Jian Gang c943fabcda Merge branch 'feature/CoAP' into 'master'
Add CoAP feature

Add CoAP protocol, support client and server test demo.

See merge request !303
2017-01-06 15:37:09 +08:00
me-no-dev 0feb3633fc add menuconfig option to enable SO_RCVBUF 2017-01-05 13:17:52 +02:00
Liu Zhi Fu 0fb2ab9f5c lwip/freertos/esp32: add throughput optimization related code
1. Update wifi lib which contains ampdu and other optimizations
2. Add throughput code debug code
3. Other misc modification about throughput optimization
2017-01-05 11:37:08 +08:00
liuhan d0b10ba2dd components/coap: Add libcoap port for ESP32 platform 2016-12-30 15:05:26 +08:00
Wu Jian Gang 0b79a108b8 Merge branch 'feature/add_ip_frag_option' into 'master'
lwip: add ip frag and reassembly option in menuconfig

add ip frag and reassembly option in menuconfig

See merge request !348
2016-12-29 11:26:06 +08:00
XiaXiaotian 15651b5923 lwip: add ip frag and reassembly option in menuconfig 2016-12-26 15:47:20 +08:00
shangke 5ddf6daa98 feature/ethernet_driver: update ethernet driver
1. The transmitting mode of the packets from LWIP to MAC is changed from synchronous to asynchronous.
2. The receive buf mode : support pointer mode and copy mode.
3. Add get phy status func used to config mac register.
2016-12-26 14:50:49 +08:00
shangke e0040af7e5 ethernet: add first version of ethernet driver 2016-12-01 19:17:48 +08:00
Xia Xiaotian ad555d68d3 esp32/lwip: add check sleep
1. fix tw8911 sleep in scan leads to auth frame malloc fail.

2. fix tw8913 pm state transfer wrong leads to wdt.

3. make some comments for modem sleep and wpa2 enterprise.

4. removd duplicated debug option ESP_THREAD_SAFE_DEBUG
2016-12-01 13:34:36 +08:00
Liu Zhi Fu fc2883a59a lwip: modify according code review
1. Modify tcp window size/send buffer back to 4/2
2. Disable lwip statistics by default
2016-11-28 19:54:22 +08:00
Liu Zhi Fu 9a3f9af2db esp32/lwip: some misc changes
1. Update phy to fix HT40 rx issue
2. Add code about RX_DONE/TX_DONE/Lock-free optimization
3. Fix wifi ioctl return value error
4. Add lwip statistics debug code
5. Modify TCP window size to 10 and send buffer size to 5
2016-11-28 18:36:14 +08:00
Wu Jian Gang 7f2c6a9d80 Merge branch 'bugfix/tw8770_fix_socket_memory_leak' into 'master'
lwip: fix socket memory leak issue

1. Add socket memory leak debug counter
2. Fix TCP PCB leak issue
    Currently ESP32 support maximum 16 TCP PCBs and all TCP PCB are allocated from heap memory. In some scenario, we may
    have memory leak issue,  for example, the application already created 16 TCP PCB, then it close 5 of them, because the TCP
    state machine, the LWIP core may not free all the 5 TCP PCB immediately, maybe some is in TIME_WAIT status, some is in 
    FIN_WAIT_1 etc. Then the application try to malloc 17th TCP PCB (the application think they just create 12 because they already
    close 5), memp_malloc() will return true because the heap is not out of memory, but actually we got 17 TCP PCB. When the 
    scenario repeat again and again (in our Audio application, it repeat more than 10000 times), more and more TCP PCB will be
    created in the system, each TCP PCB require 200B, then memory leak happen (In Audio application, I saw more than 26 TCP PCB
    are created, and 10*200=2K memory are leaked).

See merge request !223
2016-11-25 13:44:02 +08:00
Wu Jian Gang e05fe28574 Merge branch 'bugfix/arp_queue_failed' into 'master'
report the arp queue fail result



See merge request !227
2016-11-22 14:45:44 +08:00
tianzhongxing cc39b7b286 components/lwip/arp: change the arp dropping packet function
LWIP will drop the oldest package at the arp packet cache queue and return "ERR_OK"
We change it that ARP level will drop the current packet and return "ERR_MEM" to tell user that you should send the packet again latter.
2016-11-22 10:11:52 +08:00
Liu Zhi Fu 9cc9710a27 lwip: update according to review comments
1. Define memp_malloc/memp_free as static inline function
2. When TCP pcb is out of memory, try to kill PCB in FIN_WAIT_1 when necessary
2016-11-21 15:02:36 +08:00
tzx a8fb9f2b84 ipv6 interface: add branch for ipv6 interface 2016-11-21 11:06:51 +08:00
Liu Zhi Fu ab92d43bc6 lwip: fix socket memory leak issue
1. Add socket memory leak debug counter
2. Fix TCP PCB leak issue
2016-11-19 14:57:42 +08:00
Liu Zhi Fu 5e428f21b6 lwip: default ESP_L2_TO_L3_COPY to 0 2016-11-17 10:53:00 +08:00
Liu Zhi Fu 69dbc36a1c lwip: add option to memcopy packet from L2 to L3
Menuconfig add an option to copy the packet from layer2 (WIFI driver) to layer3 (LWIP), default not copy
2016-11-16 16:24:41 +08:00