Commit graph

420 commits

Author SHA1 Message Date
Konstantin Kondrashov
7e5be1b58c sntp/lwip: Add some modes for time synchronization
Closes: IDF-236
Closes: https://github.com/espressif/esp-idf/pull/1668
2019-04-15 18:11:47 +08:00
Renz Christian Bagaporo
90ee405afd ldgen: update component linker fragment files 2019-04-04 15:57:34 +08:00
morris
79bb5de426 derive esp_wifi from esp32 component 2019-04-01 20:04:52 +08:00
morris
dbdb299bb1 create xtensa component
1. move xtensa specific files out of esp32 component
2. merge xtensa-debug-module component into xtensa
2019-03-27 20:24:28 +08:00
Roland Dobai
2df9fb057d VFS: Allocate socket select semaphore outside ISR 2019-03-22 13:47:32 +00:00
David Cermak
bc60bbbeaf fuzzer tests: update of mdns and lwip host compilation for fuzzer testing
Closes IDF-540
2019-03-22 11:37:26 +01:00
Ivan Grokhotkov
57e1b5dad8 Merge branch 'bugfix/newlib_fcntl_r_signature' into 'master'
vfs: change fcntl argument to int (instead of va_list), add weak fcntl

See merge request idf/esp-idf!4549
2019-03-21 18:30:34 +08:00
Ivan Grokhotkov
1d0bffb20a lwip, wpa_supplicant: use endianness macros from libc if possible 2019-03-19 22:15:32 +08:00
Ivan Grokhotkov
48b1433772 vfs: change fcntl argument to int (instead of va_list), add weak fcntl 2019-03-19 21:44:17 +08:00
zhangyanjiao
fa2998d70b dhcpserver: suppress send_nak debug output
Closes https://github.com/espressif/esp-idf/issues/2924
2019-03-14 14:00:35 +08:00
zhangyanjiao
27cc0d1f91 modify the behavior for dhcpserver and tcpip_adapter:
1. dhcp_server: suppress send_offer debug output
2. tcpip_adapter: zero-initialize system_event_t structures
3. tcpip_adapter: pass client IP address along with SYSTEM_EVENT_AP_STAIPASSIGNED

Closes https://github.com/espressif/esp-idf/issues/2924
Closes https://github.com/espressif/esp-idf/issues/2949
2019-03-11 12:11:05 +08:00
xiehang
b88b9f4e03 fix the bug in auto Ip memory leak
Closes https://jira.espressif.com:8443/browse/WIFI-266
2019-03-06 14:44:06 +08:00
morris
302ca0022f lwip: add linker fragment
Add linker fragment file for lwip component.
2019-02-14 12:42:06 +08:00
Roland Dobai
37126d3451 Correct Kconfigs according to the coding style 2019-01-29 13:37:01 +01:00
morris
2e1f98f8f5 modem: support modem facility and PPPoS
1. add support for ESP32 DTE
2. add support for SIM800/BG96 DCE
3. add PPPoS setup procedure
4. add support for SMS
5. add mqtt example after PPP connection established
2019-01-23 18:53:32 +08:00
MartinValik
e3428adf87 Added Cmake support for dhcp_state 2019-01-10 07:51:54 +00:00
Liu Zhi Fu
6933c103e5 lwip: fix mbox thread-safe issue
Fix a mbox free thread-safe issue that can lead to crash in sys_arch_mbox_fetch.
2019-01-07 13:38:11 +08:00
Xia Xiaotian
c03f84cecf add hostname option in dhcp discover
Hostname option has been removed from dhcp discover since IDFv3.2.
But it remains in dhcp request due to which ESP32 can not get IPv4 address
from some APs. Re-add hostname option to dhcp discover to solve this issue.
2018-12-13 07:05:46 +00:00
Jiang Jiang Jian
bbdcff1f45 Merge branch 'bugfix/tw27096_fix_lwip_mbox_free_crash' into 'master'
fix the crash bug caused by sys_mbox_free

See merge request idf/esp-idf!3654
2018-11-15 10:31:35 +08:00
morris
5fccb73f86 ethernetif: fix potential memory leak
1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.
2. free intr resource in esp_eth_deinit

Closes https://github.com/espressif/esp-idf/issues/2670
2018-11-13 10:11:48 +08:00
Liu Zhi Fu
4fe3673f35 lwip: fix crash caused by sys_mbox_free
Fix lwip crashed bug caused by sys_mbox_free()
2018-11-11 12:15:51 +08:00
Peter Meerwald-Stadler
6a197d305f Fix some typos related to ethernet documentation and Kconfig. Closes https://github.com/espressif/esp-idf/pull/2642 2018-10-28 21:12:09 +01:00
Jiang Jiang Jian
129d32772e Merge branch 'feature/add_ping_packet_len_and_QoS' into 'master'
ping: add length and QoS

See merge request idf/esp-idf!3379
2018-10-19 15:29:58 +08:00
zhangyanjiao
32f3972284 add ping length and QoS 2018-10-17 09:39:27 +00:00
zhangyanjiao
e3322bde6f fix the compile bug for autoip 2018-10-17 09:32:08 +00:00
David Cermak
67153be14f lwip: updated fuzzer tests to be compatible with new lwip module 2018-10-11 08:05:14 +02:00
Jiang Jiang Jian
83d4081fba Merge branch 'bugfix/fix_close_socket_crash_bug' into 'master'
lwip: fix the crash when close socket

See merge request idf/esp-idf!3384
2018-10-08 21:23:57 +08:00
zhangyanjiao
54b431f2a8 lwip: fix the crash when close socket 2018-09-27 17:35:40 +08:00
Ivan Grokhotkov
6baf743212 Merge branch 'bugfix/lwip_compat_headers' into 'master'
lwip: add compatibility headers for sntp.h and esp_ping.h

See merge request idf/esp-idf!3231
2018-09-27 11:21:37 +08:00
Jiang Jiang Jian
da3c6220a5 Merge branch 'bugfix/IPv6_TCP_connection_fail' into 'master'
lwip: fix the bug that IPv6 TCP connection fail

See merge request idf/esp-idf!3331
2018-09-23 08:39:34 +08:00
Roland Dobai
bf443a763f tools: Support overwrite of includes for gen_esp_err_to_name.py
gen_esp_err_to_name.py includes files like
components/lwip/include/apps/esp_ping.h as "apps/esp_ping.h" because all
subdirectories of "include" are used. If "components/lwip/include/apps"
is in the path of the compiler instead of "components/lwip/include" then
include "apps/esp_ping.h" will fail. This fix allows to process lines
like:
'// gen_esp_err_to_name.py: some text "esp_ping.h" some text'
in header files for overwriting the include.
2018-09-21 14:09:37 +08:00
Ivan Grokhotkov
f8750eb58d lwip: add compatibility headers for sntp.h and esp_ping.h
Before LwIP was moved into a submodule, sntp and esp_ping were
available as the following includes:

#include "apps/sntp/sntp.h"
#include "esp_ping.h"

This commit makes header files available at the old location, and adds
a deprecation warning for sntp.h.

Closes https://github.com/espressif/esp-idf/issues/2392
2018-09-21 14:09:37 +08:00
Ivan Grokhotkov
2e6e87816c Merge branch 'feature/crosstool_backport' into 'master'
Backport of work of gcc8 toolchain to v3

See merge request idf/esp-idf!3154
2018-09-21 14:07:41 +08:00
zhangyanjiao
e7d6c861b5 lwip: fix the bug that IPv6 TCP connection fail
The lwip code didn't create an new mld group when netif is up,
this will lead to the server can't find the matching netif when
receiving NS(neighbor solicitation) packet
2018-09-21 10:17:20 +08:00
Anton Maklakov
d4cbfd34cc cmake: silence some warnings in coap, bt, expat, libsodium, lwip and examples/bluetooth 2018-09-20 18:53:15 +08:00
Anton Maklakov
3471d369f9 lwip: silence uninitialized and fallthrough warnings 2018-09-20 18:53:15 +08:00
Anton Maklakov
9a55557ad8 build system: Add a compatible old GCC flag 2018-09-20 18:53:14 +08:00
Jiang Jiang Jian
d68df94d2b Merge branch 'bugfix/fix_the_bug_create_socket_fail' into 'master'
LWIP: fix the bug that failed to create socket

See merge request idf/esp-idf!3300
2018-09-20 18:43:58 +08:00
morris
20b7f0ec87 ethernet: fix infinite loop when init phy or reset mac
1. fix infinite loop problem when init phy device
2. fix infinite loop problem when reset mac
3. fix little bugs in ethernetif_init
4. fix incompatible return value between lwip and esp-idf

Closes https://github.com/espressif/esp-idf/issues/2331
Closes https://github.com/espressif/esp-idf/issues/2141
2018-09-20 10:09:38 +08:00
zhangyanjiao
f2d3efd875 lwip: fix the bug that failed to create socket
Closes: https://github.com/espressif/esp-idf/issues/2403
        https://github.com/espressif/esp-idf/issues/2414
2018-09-19 09:44:28 +00:00
Ivan Grokhotkov
5d1ccb9501 lwip: allow setting LwIP tasks affinity via sdkconfig
In some cases applications need to ensure that WiFi/BT related tasks
run on CPU1. This option can be used to set task affinity in such case.

https://github.com/espressif/esp-idf/issues/2233#issuecomment-409220381
2018-09-17 18:17:52 +08:00
Ivan Grokhotkov
eea49d250a Merge branch 'feature/dhcp_skip_discovery' into 'master'
DHCP restore last ip and skip discovery

See merge request idf/esp-idf!3132
2018-09-17 12:27:56 +08:00
MartinValik
2e79baa1db lwip: DHCP restore last IP
Closes https://github.com/espressif/esp-idf/issues/799
2018-09-17 11:11:25 +08:00
morris
3063a62e3e ethernet: fix some bugs in ethernet driver
1. create a new pbuf to squash linked pbuf
2. optimize emac driver by adding ESP_IRAM_ATTR
3. remove duplicated function declare in esp_eth.h
4. remove duplicated code in emac_setup_tx_desc
5. disable Promiscuous mode
2018-09-17 10:12:46 +08:00
Jiang Jiang Jian
518942ec61 Merge branch 'bugfix/tw24694_dns_request_no_reply' into 'master'
lwip: add code for sending gratuitous ARP periodically

See merge request idf/esp-idf!3241
2018-09-16 15:18:32 +08:00
Angus Gratton
61835faed1 Merge branch 'bugfix/tcpip_stack_size_default' into 'master'
Default stack size for TCPIP task increased to avoid stack overflow.

See merge request idf/esp-idf!3258
2018-09-14 12:23:35 +08:00
Dmitry
2ff3f8b0c8 Stack size for TCPIP task increased from 2048 to 3072. 2018-09-13 12:38:56 +03:00
Renz Christian Bagaporo
944014f9f2 cmake: fix source list issues 2018-09-13 08:56:59 +08:00
zhangyanjiao
237cc88b9f lwip: add code for sending gratuitous ARP periodically 2018-09-11 14:36:42 +08:00
Renz Christian Bagaporo
d9939cedd9 cmake: make main a component again 2018-09-11 09:44:12 +08:00
Angus Gratton
deb46b415f lwip: Re-add CONFIG_PPP_SUPPORT check, remove redundant CFLAGS 2018-09-06 20:23:20 +08:00
Angus Gratton
cff2ef695a Merge branch 'master' into feature/cmake 2018-09-06 20:23:04 +08:00
Zhang Yan Jiao
3578fe39e0 Feature/sync lwip as submodule 2018-09-06 19:43:08 +08:00
Angus Gratton
a9c4ed7139 Merge branch 'master' into feature/cmake 2018-08-30 18:51:01 +08:00
Angus Gratton
414b84c041 Merge branch 'feature/ci_fuzzer_tests_lwip' into 'master'
ci jobs running fuzz tests on dns, dhcp, dhcps + removed unnecessary references (libexpat)

See merge request idf/esp-idf!2866
2018-08-27 16:25:21 +08:00
David Cermak
882ca87442 lwip: removed ASSERT in dhcp as the error might occur in runtime if packet is altered 2018-08-22 12:13:34 +02:00
David Cermak
ebebda9604 lwip: supported ci jobs running fuzz tests on dns, dhcp, dhcps 2018-08-22 12:13:20 +02:00
Angus Gratton
ff2404a272 Merge branch 'master' into feature/cmake 2018-08-16 17:14:17 +10:00
David Cermak
1ef13c524c asio: initial idf port of asio library without ssl 2018-07-30 06:28:43 +00:00
David Cermak
eee34ddd91 lwip fix for udp receivefrom 2018-07-30 06:28:43 +00:00
zhangyanjiao
d90f8c06c2 changes for timers 2018-07-17 16:46:53 +08:00
Jiang Jiang Jian
70f3933db1 Merge branch 'bugfix/tw23835_add_source_ip_route_for_unicast' into 'master'
lwip: add source ip based route for unicast packet

See merge request idf/esp-idf!2757
2018-07-16 17:01:16 +08:00
Jiang Jiang Jian
a22d6607f8 Merge branch 'bugfix/autoip_compilation' into 'master'
LWIP AutoIP Compilation Fixed by defining IP_IS_V4_VAL()

See merge request idf/esp-idf!2758
2018-07-15 15:19:11 +08:00
Piyush Shah
fd8a7666c8 LWIP AutoIP Compilation Fixed by defining IP_IS_V4_VAL() 2018-07-13 15:04:39 +05:30
Liu Zhi Fu
2e1427a239 lwip: add source ip based route for unicast packet
Add source IP based route for unicast packets forwarding.
2018-07-13 12:35:17 +08:00
Angus Gratton
a67d5d89e0 Replace all DOS line endings with Unix
Command run was:
git ls-tree -r HEAD --name-only | xargs dos2unix
2018-07-12 19:10:37 +08:00
Jiang Jiang Jian
9d830a6f7c Merge branch 'bugfix/tw23667_tcp_pcb_purge_assert' into 'master'
lwip: fix the assertion in tcp_pcb_purge()

See merge request idf/esp-idf!2657
2018-07-10 10:16:47 +08:00
Jiang Jiang Jian
6bf435217e Merge branch 'bugfix/disable_lwip_trust_ip_by_default' into 'master'
lwip: disable ETHARP_TRUST_IP_MAC by default

See merge request idf/esp-idf!2652
2018-07-09 10:03:30 +08:00
Liu Zhi Fu
49c236d613 lwip: fix the assertion in tcp_pcb_purge()
Fix the assertion in tcp_pcb_purge().
2018-07-05 14:29:03 +08:00
Liu Zhi Fu
c84a2b9027 lwip: disable ETHARP_TRUST_IP_MAC by default
Disable ETHARP_TRUST_IP_MAC by default because:
1. The LAN peer may not be trustful
2. The LAN peer may has problem to update its ARP entry
2018-07-02 13:38:29 +08:00
Angus Gratton
df816f4940 lwip: Fix leak when accept() fails due to max socket limit
As reported https://esp32.com/viewtopic.php?f=14&t=6171

event_callback() in sockets.c calls conn->socket-- to register
activity on a netconn which may not have any socket yet,
so any socket value < 0 indicates "no controlling socket"
for the netconn.
2018-06-21 15:22:48 +10:00
zhangyanjiao
b5f4bf922f fix the bug that TCP connections don't abort when IP changed 2018-06-14 16:56:39 +08:00
zhangyanjiao
1bab62a6d6 modify dhcp offer MTU to 1500 2018-06-07 10:03:26 +08:00
Liu Zhi Fu
6cc95809fb lwip: fix tcp_pcb_purge assert
Remove the assert in tcp_pcb_purge()
2018-06-06 10:25:01 +08:00
Angus Gratton
6b9784cc45 Merge branch 'master' into feature/cmake_update 2018-05-31 14:46:23 +10:00
Ivan Grokhotkov
ddff375bab Merge branch 'feature/ci_fail_on_executable_files' into 'master'
CI: check source files for executable flag

See merge request idf/esp-idf!2463
2018-05-30 11:41:06 +08:00
Ivan Grokhotkov
4ea2cab208 Merge branch 'cermak_dhcpserver_fuzzer_test' into 'master'
LWIP_Fuzzer: Added AFL tests for lwip dhcpserver, client and dns

See merge request idf/esp-idf!2399
2018-05-29 22:28:43 +08:00
Ivan Grokhotkov
cb649e452f remove executable permission from source files 2018-05-29 20:07:45 +08:00
Nicola Lunghi
2f433e4342 netif require vfs 2018-05-29 16:34:45 +10:00
Roland Dobai
e86738205d Fix redefinition of select() on platforms where ESP_PLATFORM is discarded
Ref: https://github.com/espressif/esp-idf/issues/1987
2018-05-25 13:37:43 +00:00
Roland Dobai
004bf84d8c VFS: Optionally disable the VFS implementation of select()
This allows to temporarily resolve issues like
https://github.com/espressif/esp-idf/issues/1987
while bugs are fixed in the VFS implementation of select().
2018-05-23 10:14:16 +02:00
zhangyanjiao
3f031cdd9d add event SYSTEM_EVENT_AP_STAIPASSIGNED 2018-05-19 13:14:12 +08:00
David Cermak
bb25d0a348 DnsFuzzer: Added fuzzer test for exercising lwip/dns receiving DNS responses 2018-05-18 15:54:08 +02:00
Roland Dobai
18e83bcd53 Allow VFS file descriptors in select() 2018-05-18 08:06:33 +02:00
David Cermak
5ecf717e40 DhcpFuzzer: dhcp client addded 2018-05-16 14:52:42 +02:00
David Cermak
3a6d256d3e DhcpFuzzer: Added AFL test for dhcpserver with sample packets 2018-05-14 15:03:37 +02:00
Jiang Jiang Jian
41228c83c7 Merge branch 'bugfix/dhcp_server_max_limit' into 'master'
dhcp/dhcpserver Fix max station limit check in dhcp server

See merge request idf/esp-idf!2298
2018-05-11 15:50:38 +08:00
Roland Dobai
5129bca67c VFS: Use smaller numbers as file descriptors 2018-05-07 09:01:56 +02:00
Angus Gratton
381be65472 cmake: Build all examples in CI
Includes some fixes for compile errors/warnings in examples.
2018-04-30 10:18:33 +10:00
Angus Gratton
1cb5712463 cmake: Add component dependency support
Components should set the COMPONENT_REQUIRES & COMPONENT_PRIVATE_REQUIRES variables to define their
requirements.
2018-04-30 09:59:20 +10:00
Angus Gratton
88df8fd293 cmake: Use cmake_lint project, tidy up all CMake source files 2018-04-30 09:59:20 +10:00
Angus Gratton
9f8cdd3572 cmake: Add "Preview release" getting start guide & build system documentation 2018-04-30 09:59:20 +10:00
Angus Gratton
c671a0c3eb build system: Initial cmake support, work in progress 2018-04-30 09:59:20 +10:00
Sagar Bijwe
21584827b3 dhcp/dhcpserver Fix max station limit check in dhcp server
Currently when MAX_STATION limit in DHCP config is set to N, dhcp server
issues only N-1 IP addresses. This is problematic from customer
perspective if both SoftAP MAX_STATION and DHCP MAX_STATION limit is set
to same value. With this change DHCP server can issue N addresses that
is inline with the set limit.

Closes TW<20556>
2018-04-24 17:36:55 +05:30
Ivan Grokhotkov
6185e722c3 Revert "Merge branch 'feature/vfs_select' into 'master'"
This reverts merge request !2074
2018-04-20 11:51:41 +08:00
Roland Dobai
6852d653bd Allow VFS file descriptors in select() 2018-04-17 11:25:30 +02:00
Xia Xiaotian
e727582180 Fix two WiFi and LWIP typos
1. close github issue: https://github.com/espressif/esp-idf/issues/1792
    2. close github issue: https://github.com/espressif/esp-idf/issues/1781
2018-04-05 11:46:42 +08:00
Roland Dobai
7c4b3d50f8 Make error codes globally unique 2018-03-27 08:12:54 +02:00
Jiang Jiang Jian
1d49c0953e Merge branch 'bugfix/close_socket_when_tcp_connecting' into 'master'
Close socket request will abort tcp write/connect

See merge request idf/esp-idf!1687
2018-03-08 20:34:40 +08:00
Angus Gratton
aedb807a02 Merge branch 'bugfix/esp_ping_ms_pr1638' into 'master'
esp_ping - Document that timeout units are in milliseconds

See merge request idf/esp-idf!1968
2018-02-26 08:00:44 +08:00
Piyush Shah
6dbb040890 FD_ZERO: Fix a compilation warning
Definition of memset is not found if string.h is not included anywhere

Signed-off-by: Piyush Shah <piyush@espressif.com>
2018-02-22 14:10:04 +05:30
Chris Morgan
86bf8798b2 esp_ping - Document that timeout units are in milliseconds
Remove 1000 multiplier from esp_ping_set_target() parameters that define time
2018-02-18 18:47:46 -05:00
Roland Dobai
f44cbe9033 Change ESP_ERR_PING_BASE because of collision with ESP_ERR_TCPIP_ADAPTER_BASE 2018-02-06 12:34:12 +01:00
Liu Zhi Fu
2242bf9b37 lwip/esp32/examples: wifi throughput optimizations
1. Put some lwip udp rx/tx relating functions to IRAM
2. Put some wifi rx/tx relating functions to IRAMa
3. Reduce wifi dynamic malloc from 4 to 1 for each ebuf
4. Update iperf example accordingly
5. Update libphy.a to v383
2018-01-30 16:27:49 +08:00
Chen Wu
ffc2db0a35 fix(ping): fix crash when multi-ping
1. "lwip_socket" should close by "lwip_close_r" other than "lwip_close"
2. for generally compatible, fix all lwip interface to normally socket interface
3. call vTaskDelete when new socket failed in case of task crash

close #https://github.com/espressif/esp32-at/issues/58
2018-01-12 15:54:07 +08:00
XiaXiaotian
32c0d74cc5 Close socket request will abort tcp write/connect
When tcp write/connect is running, close socket request will abort
    it and continue to delete netconn and close tcp. Do not immediately
    return after aborting tcp write/connect. Otherwise, tcp close
    requeset will block and tcp write/connect will crash.
2017-12-19 15:20:50 +08:00
zhangyanjiao
210d349fbd when netconn created directly,netconn_delete() will not call netconn_free(),
which will lead to memory leak

Closes https://github.com/espressif/esp-idf/issues/784
2017-12-05 10:42:37 +08:00
Jiang Jiang Jian
aece22f763 Merge branch 'bugfix/tw16581_dhcps_default_behaviour_changed' into 'master'
fix the dhcps default behaviour chenged by dns

See merge request !1612
2017-12-01 19:21:26 +08:00
Ivan Grokhotkov
cc600bd517 Merge branch 'bugfix/fix_lwip_macros' into 'master'
lwip: Change socket API macros to static-inline

See merge request !1614
2017-11-30 10:28:20 +08:00
Kedar Sovani
1c0543fb17 lwip: Change socket API macros to static-inline 2017-11-29 11:42:14 +05:30
Angus Gratton
1d5389668b Merge branch 'feature/dhcp_server_options_menuconfig' into 'master'
dhcpserver: Option to change lease time multiplier and number of max

See merge request !1595
2017-11-29 07:07:09 +08:00
zhangyanjiao
e315d7ca08 fix the dhcps default behaviour chenged by dns
Closes https://github.com/espressif/esp-idf/issues/1285
2017-11-28 16:39:00 +08:00
Krzysztof Bociurko
626ad5f577 dhcpserver: Option to change lease time multiplier and number of max
stations connected to it.

Merges: https://github.com/espressif/esp-idf/pull/1206
2017-11-28 15:58:03 +11:00
Jiang Jiang Jian
a83fbd3364 Merge branch 'bugfix/tw16287_tcp_send_succeed_after_station_disconnect' into 'master'
In STA mode, tcp_send cannot catch err after disconnect station

See merge request !1540
2017-11-27 21:30:46 +08:00
zhangyanjiao
0b644ee515 fix tcp connect/disconnect carsh 2017-11-27 10:18:58 +08:00
Angus Gratton
4ce68f6163 lwip: Expose number of active socket limits in menuconfig 2017-11-22 14:10:08 +11:00
zhangyanjiao
9fbcc6f922 In STA mode, tcp_send cannot catch err after disconnect station 2017-11-20 15:19:19 +08:00
Liu Zhi Fu
095d163050 lwip: rebind UDP/TCP pcb to valid ip address when ip is changed
This change fix the issue UDP/TCP pcb failed to rebind to correct ip address when ip is changed
2017-11-15 16:15:24 +08:00
Liu Zhi Fu
48ca949fd4 lwip: fix socket close crash issue
When lwip_close free the socket resource (netconn etc), any work
related to these resource (netconn etc) must be aborted.
2017-11-13 06:00:52 +00:00
Jiang Jiang Jian
004c391591 Merge branch 'feature/adjust_task_stack_size_according_to_nano' into 'master'
esp32/lwip: adjust task stack size according 'nano' print

See merge request !1510
2017-11-13 11:18:20 +08:00
Liu Zhi Fu
710055025e esp32/lwip: adjust task stack size according 'nano' print
1. Adjust tcpip/main/event/timer task stack size according 'nano' print
2. If 'nano' print is disabled the task stack size reduces 512 bytes
2017-11-09 10:09:42 +08:00
Dmitry4Bh
a0cedb1f44 Fix type conversion error in components/lwip/api/pppapi.c
Pointer tcpip_api_call *m  should be converted to pppapi_msg* instead of pppapi_msg_msg*
in pppapi_do_ppp_set_default(), pppapi_do_ppp_free() and so on.

It solve this issue https://github.com/espressif/esp-idf/pull/1028
so there is no need to patch ip4.c because now netif_defauilt is setted correctly.
Also it prevents memory corruption when pppapi_free() is called.
2017-11-03 16:42:56 +08:00
Angus Gratton
696dfbcfee Merge branch 'bugfix/fix_tcp_crash' into 'master'
fix tcp crash

See merge request !1444
2017-10-31 06:18:49 +08:00
Angus Gratton
5c5d5f0acb Merge branch 'bugfix/tcpip_stack_overflow_logging_printf' into 'master'
lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose

See merge request !1396
2017-10-26 15:09:22 +08:00
zhangyanjiao
18dcbfa1e2 fix tcp crash 2017-10-24 09:44:44 +08:00
Ivan Grokhotkov
552ba35da5 add missing ioctl declaration
Previously ioctl was declared as a macro in lwip/sockets.h.
Disabling LWIP_POSIX_SOCKETS_IO_NAMES removed that declaration.

This adds sys/ioctl.h file and the missing declaration.
Also adds missing includes in vfs.c.
2017-10-23 19:47:33 +08:00
Angus Gratton
e5ae0f5927 lwip: Make LWIP_SOCKET_OFFSET signed, remove need for underflow check
This reverts commit 541493d877.
2017-10-20 18:04:28 +08:00
Liu Zhi Fu
cf7ae8135b tcpip_adapter/lwip: make dhcp domain name server option configurable
Add api to configure dhcp option: domain name server

1.closes https://github.com/espressif/esp-idf/issues/162

2.closes https://github.com/espressif/esp-idf/issues/705
2017-10-19 19:28:00 +08:00
Angus Gratton
86c89ff169 pthread: Add support for pthread thread local storage
Refactors LWIP to use this for the LWIP thread local semaphore
2017-10-17 14:46:08 +08:00
Angus Gratton
90bf40587e Merge branch 'feature/sockets_files_shared_fd_space' into 'master'
lwip & vfs: POSIX I/O functions operate on sockets and files (first stage, no select() yet)

See merge request !1352
2017-10-17 14:17:09 +08:00
Jiang Jiang Jian
50c993a1b2 Merge branch 'feature/some_refactor_for_esp_ping' into 'master'
lwip: refactor to socket ping

See merge request !875
2017-10-16 17:30:00 +08:00
Angus Gratton
539262b5c2 vfs: Remove fd_offset member
This was intended for integrating LWIP, but a different approach was used.
2017-10-16 09:45:50 +08:00
Angus Gratton
541493d877 lwip: Check for underflow in FD_SET()/FD_GET()
select() only works with LWIP sockets which have a high LWIP_SOCKET_OFFSET,
so chance of accidental underflow is high.
2017-10-16 09:45:50 +08:00
Angus Gratton
3f83914f7a lwip: Fix bug with LWIP_SOCKET_OFFSET & IGMP group support 2017-10-16 09:45:50 +08:00
Angus Gratton
3ebf7923d3 lwip: Route LWIP socket POSIX I/O functions via IDF VFS layer
No more conflicts between LWIP & newlib read(), write(), fcntl(), etc.

select() still only works if all of the fds are sockets.

Closes https://github.com/espressif/esp-idf/issues/273
2017-10-16 09:45:49 +08:00
Angus Gratton
0c50b65a34 lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose
... unless nano formatting is enabled.

Fixes stack overflow in tcpip_adapter at the default level, as reported on forum:
https://esp32.com/viewtopic.php?f=2&t=3250&p=15538#p15447
2017-10-16 09:43:23 +08:00
Liu Zhi Fu
3bcaa592ee lwip: refactor to socket ping
Do some refactor to socket ping:
1. Add ping_deinit to kill ping thread
2. Apply configuration set by esp_ping_set_target to socket ping
3. Limit only one ping thread
2017-10-13 16:37:09 +08:00
Liu Zhi Fu
e2d077cea1 lwip: init lwip error code
Init the error code to ERR_OK when call tcpip_apimsg
2017-10-13 15:59:04 +08:00
XiaXiaotian
5df39cd4b6 Allocate some memories in SPIRAM first.
Try to allocate some WiFi and LWIP memories in SPIRAM first. If
    failed, try to allocate in internal RAM then.
2017-10-13 10:11:24 +08:00
XiaXiaotian
ad1350f0ac Release DHCP structure memory when netif is down. 2017-10-12 17:03:44 +08:00
Angus Gratton
3fdb1944d3 lwip: Disable IPV4 Link-Local addressing by default
Keeps existing IDF behaviour the same. Can still be enabled via menuconfig.
2017-10-02 10:50:27 +11:00
Angus Gratton
2cc8c91ad8 lwip: Remove undocumented CONFIG_MDNS macro flag
All options that were enabled via CONFIG_MDNS are now in menuconfig, with
the default values set the same as with CONFIG_MDNS enabled (meaning existing
projects that were using CONFIG_MDNS do not need to change).
2017-10-02 10:50:27 +11:00
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
Ivan Grokhotkov
b7a79ab67e Merge branch 'bugfix/bind_dhcp_server_udp_to_ip_of_ap' into 'master'
Fix the bug that if one device is in station+softap mode, other device can not get IP address after connecting to the softap.

See merge request !1314
2017-09-26 16:06:55 +08:00
Liu Zhi Fu
05b0d567e5 example: add iperf example
Support iperf
2017-09-26 09:19:01 +08:00
XiaXiaotian
20064978ba Fix the bug that if one device is in station+softap mode, other device can not
get IP address after connecting to the softap.

    Now the default netif is station in station+softap mode. The UDP pcb of
DHCP server is binded to IP 0.0.0.0. When other device connects to softap, the
DHCP offer will be sent by softap.But because the destination IP of DHCP offer
is broadcast IP and the source IP of it is 0.0.0.0, it will be sent from default
netif, that is station interface. Other device can not receive the DHCP offer
sent from station interface. As a result, other device can not get IP address.
The resolution is that bind UDP pcb to the IP address of softap. So, the source
IP of DHCP offer is that of softap. DHCP offer can be sent from softap interface
by source IP route method.
2017-09-23 20:18:50 +08:00
zhangyanjiao
336c4b4a55 fix lwip tcp_oversize_dbgcheck assert 2017-09-15 10:28:51 +08:00
zhangyanjiao
164006509f optimize lwip route when loopback open and in "APSTA" mode 2017-09-14 16:19:05 +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