Skip to content

Commit b0ba3d3

Browse files
authored
Merge pull request #10353 from tymoteuszblochmobica/multihoming
Update to LWIP 2.1.2
2 parents 6270de6 + 42b5680 commit b0ba3d3

File tree

302 files changed

+42509
-12978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+42509
-12978
lines changed

TESTS/netsocket/tcp/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ static void test_failure_handler(const failure_t failure)
194194

195195

196196
Case cases[] = {
197+
Case("TCPSOCKET_OPEN_LIMIT", TCPSOCKET_OPEN_LIMIT),
197198
Case("TCPSOCKET_ECHOTEST", TCPSOCKET_ECHOTEST),
198199
Case("TCPSOCKET_ECHOTEST_NONBLOCK", TCPSOCKET_ECHOTEST_NONBLOCK),
199200
Case("TCPSOCKET_OPEN_CLOSE_REPEAT", TCPSOCKET_OPEN_CLOSE_REPEAT),
200-
Case("TCPSOCKET_OPEN_LIMIT", TCPSOCKET_OPEN_LIMIT),
201201
Case("TCPSOCKET_THREAD_PER_SOCKET_SAFETY", TCPSOCKET_THREAD_PER_SOCKET_SAFETY),
202202
Case("TCPSOCKET_CONNECT_INVALID", TCPSOCKET_CONNECT_INVALID),
203203
Case("TCPSOCKET_ECHOTEST_BURST", TCPSOCKET_ECHOTEST_BURST),

TESTS/network/multihoming/main.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#error [NOT_SUPPORTED] Both Wifi and Ethernet devices are required for multihoming tests.
3030
#endif
3131

32+
#define STRING_VERIFY(str) (str != NULL ? str : "not supported")
33+
3234

3335
#include "greentea-client/test_env.h"
3436
#include "unity/unity.h"
@@ -95,13 +97,12 @@ static void _ifup()
9597
TEST_FAIL_MESSAGE("Wifi connection error!");
9698
return;
9799
}
98-
wifi->get_interface_name(interface_name[interface_num]);
99-
printf("MAC: %s\n", wifi->get_mac_address());
100-
printf("IP: %s\n", wifi->get_ip_address());
101-
printf("Netmask: %s\n", wifi->get_netmask());
102-
printf("Gateway: %s\n", wifi->get_gateway());
100+
printf("Wifi interface name: %s\n\n", STRING_VERIFY(wifi->get_interface_name(interface_name[interface_num])));
101+
printf("MAC: %s\n", STRING_VERIFY(wifi->get_mac_address()));
102+
printf("IP: %s\n", STRING_VERIFY(wifi->get_ip_address()));
103+
printf("Netmask: %s\n", STRING_VERIFY(wifi->get_netmask()));
104+
printf("Gateway: %s\n", STRING_VERIFY(wifi->get_gateway()));
103105
printf("RSSI: %d\n\n", wifi->get_rssi());
104-
printf("Wifi interface name: %s\n\n", interface_name[interface_num]);
105106
interface_num++;
106107
} else {
107108
TEST_FAIL_MESSAGE("ERROR: No WiFiInterface found!");

features/lwipstack/.mbedignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ lwip/test/*
33
lwip/src/apps/*
44
lwip/src/netif/lwip_slipif.c
55
lwip/src/include/lwip/apps/*
6-
lwip/src/include/posix/*
6+
lwip/src/include/compat/stdc/*
77
lwip-eth/*

features/lwipstack/LWIPStack.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -514,19 +514,9 @@ nsapi_error_t LWIP::setsockopt(nsapi_socket_t handle, int level, int optname, co
514514
if (optlen > NSAPI_INTERFACE_NAME_MAX_SIZE) {
515515
return NSAPI_ERROR_UNSUPPORTED;
516516
}
517-
#if LWIP_TCP
518-
if (NETCONNTYPE_GROUP(s->conn->type) == NETCONN_TCP) {
519-
s->conn->pcb.tcp->interface_name = (const char *)optval;
520-
}
521-
#endif
522-
if (NETCONNTYPE_GROUP(s->conn->type) == NETCONN_UDP) {
523-
s->conn->pcb.udp->interface_name = (const char *)optval;
524-
}
525-
#if LWIP_RAW
526-
if (NETCONNTYPE_GROUP(s->conn->type) == NETCONN_RAW) {
527-
s->conn->pcb.raw->interface_name = (const char *)optval;
528-
}
529-
#endif
517+
518+
netconn_bind_if(s->conn, netif_name_to_index((const char *)optval));
519+
530520
return 0;
531521
#if LWIP_TCP
532522
case NSAPI_KEEPALIVE:

features/lwipstack/lwip-sys/arch/lwip_sys_arch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg) {
212212
return ERR_OK;
213213
}
214214

215+
err_t
216+
sys_mbox_trypost_fromisr(sys_mbox_t *q, void *msg)
217+
{
218+
return sys_mbox_trypost(q, msg);
219+
}
220+
215221
/*---------------------------------------------------------------------------*
216222
* Routine: sys_arch_mbox_fetch
217223
*---------------------------------------------------------------------------*

features/lwipstack/lwip/CHANGELOG

Lines changed: 272 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,278 @@
11
HISTORY
2+
* These are only the most important changes. For a full list, use git log:
3+
http://git.savannah.nongnu.org/cgit/lwip.git
24

35
(git master)
46

57
* [Enter new changes just after this line - do not remove this line]
68

9+
(STABLE-2.1.2):
10+
11+
++ Bugfixes:
12+
13+
2018-11-21: Jens Nielsen
14+
* netbiosns.c: fix expecting too large packet (bug #55069)
15+
16+
2018-11-19: Dirk Ziegelmeier
17+
* smtp.c: fix compiling with strict C compatibility because of strnlen (bug #55034)
18+
19+
2018-11-12: Simon Goldschmidt
20+
* tcp.c: fix overflow check in tcp_recved triggering invalid assertion (bug #55015)
21+
22+
2018-11-12: Simon Goldschmidt
23+
* tcp.c: fix a bug in sending RST segments (sent from port 0)
24+
25+
(STABLE-2.1.1):
26+
27+
++ Bugfixes:
28+
29+
2018-11-01: Joan Lledó
30+
* sockets.c: fix bad assertion in lwip_poll_dec_sockets_used() (bug #54933)
31+
32+
2018-11-01: Dirk Ziegelmeier
33+
* ip4.c: don't send 127.* to default netif (bug #54670)
34+
35+
2018-10-23: David Girault
36+
* altcp_tls_mbedtls.c: fix use-after free (bug #54774)
37+
38+
2018-10-23: Ognjen Bjelica, Dirk Ziegelmeier
39+
* snmp_scalar.c: Avoid NULL pointer dereference (bug #54886)
40+
41+
2018-10-23: Simon Goldschmidt
42+
* Fix missing standard includes in multiple files
43+
44+
2018-10-17: Ivan Warren
45+
* def.h: fix casting htonX and ntohX to u16_t (bug #54850)
46+
47+
2018-10-12: Simon Goldschmidt
48+
* Revert "tcp_abandon: no need to buffer pcb->local_port" (fix that source port was 0 for RST
49+
called when aborting a connection)
50+
51+
2018-10-11: Jonas Rabenstein
52+
* tcp.c: tcp_recved: check for overflow and warn about too big values (patch #9699)
53+
54+
2018-10-06: Joan Lledó
55+
* sockets.c: alloc_socket(): Check for LWIP_SOCKET_POLL when setting select-
56+
related variables (patch #9696)
57+
58+
2018-10-04: Spencer
59+
* tcp.c: Update prev pointer when skipping entries in tcp_slowtmr (patch #9694)
60+
61+
2018-09-27: Martine Lenders
62+
* lowpan6.c: Fix IEEE 802.15.4 address setting (bug #54749)
63+
64+
(STABLE-2.1.0):
65+
66+
++ New features:
67+
68+
2018-06-17: Simon Goldschmidt
69+
* lwiperf: implemented iPerf client mode
70+
71+
2018-04-23: Dirk Ziegelmeier
72+
* added cmake build files
73+
74+
2018-03-04: Ray Abram
75+
* netbios responder: respond to '*' queries
76+
77+
2018-02-23: Benjamin Aigner
78+
* 6lowpan: add 6lowpan-over-BLE netif (based on existing 6lowpan netif)
79+
80+
2018-02-22: Simon Goldschmidt
81+
* ipv6: add support for stateless DHCPv6 (to get DNS servers in SLAAC nets)
82+
83+
2018-02-16: Simon Goldschmidt
84+
* add raw API http(s) client (with proxy support)
85+
86+
2018-02-01: Simon Goldschmidt
87+
* tcp: add hooks to implement additional socket options
88+
89+
2018-02-01: Simon Goldschmidt
90+
* tcp: add hooks to implement tcp md5 signatures or similar (see contrib/addons for an example)
91+
92+
2018-01-05: Simon Goldschmidt
93+
* Added sys_mbox_trypost_fromisr() and tcpip_callbackmsg_trycallback_fromisr()
94+
These can be used to post preallocated messages from an ISR to the tcpip thread
95+
(e.g. when using FreeRTOS)
96+
97+
2018-01-02: Dirk Ziegelmeier
98+
* task #14780: Add debug helper asserts to ensure threading/locking requirements are met
99+
100+
2017-11-21: Simon Goldschmidt
101+
* task #14600: tcp_alloc(): kill TF_CLOSEPEND connections before other ESTABLISHED
102+
103+
2017-11-21: Simon Goldschmidt
104+
* makefsdata: added option "-ssi:<filename>" to control SSI tag checking/insertion
105+
through a list of filenames, not by checking the file extension at runtime
106+
107+
2017-11-20: Joel Cunningham
108+
* netconn: add LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE to use external DNS resolver (patch #9427)
109+
110+
2017-11-14: Joel Cunningham
111+
* netifapi: Add thread safe ARP cache APIs (task #14724)
112+
113+
2017-11-06: Axel Lin
114+
* TCP: kill existing connections with a LOWER priority than the one currently being opened.
115+
Previous implementations also kill existing connections of the SAME priority.
116+
117+
2017-09-21: Kalle Olavi Niemitalo
118+
* sockets: add poll() implementation (patch #9450)
119+
120+
2017-09-10: Joel Cunningham
121+
* sockets: add readv() implementation (task #14610)
122+
123+
2017-08-04: Simon Goldschmidt
124+
* Clean up DHCP a bit: no need keep msg_out and msg_in as members in struct
125+
dhcp - they are used in a call stack only (p_out and options_out_len as well)
126+
127+
2017-08-04: Simon Goldschmidt
128+
* pbuf: split pbuf_header(s16_t) into pbuf_add_header(size_t) and
129+
pbuf_remove_header(size_t)
130+
131+
2017-07-20: Douglas
132+
* sys: deprecate sys_arch_sem_wait and sys_arch_mbox_fetch returning the
133+
time waited rather they are now defined to return != SYS_ARCH_TIMEOUT
134+
on success.
135+
136+
2017-07-03: Jakub Schmidtke
137+
* tcp: added support for sending TCP SACKs
138+
139+
2017-06-20: Joel Cunningham
140+
* netconn/netdb: added core locking support to netconn_gethostbyname (task #14523)
141+
142+
2017-04-25: Simon Goldschmidt
143+
* dhcp: added two hooks for adding and parsing user defined DHCP options
144+
145+
2017-04-25: Joel Cunningham
146+
* sockets: added recvmsg for UDP (together with CMSG and IP_PKTINFO) (task #14247)
147+
148+
2017-04-20: Joel Cunningham
149+
* tcp: added Appropriate Byte Counting support (task #14128)
150+
151+
2017-04-11: Simon Goldschmidt
152+
* netconn/sockets: remove fatal error handling, fix asynchronous error handling,
153+
ensure data before RST can be received
154+
155+
2017-03-30: Simon Goldschmidt
156+
* added "application layered TCP" connection API (altcp) for seamless integration
157+
of TLS or proxy connections
158+
159+
2017-03-09: Simon Goldschmidt
160+
* sockets: add recvmsg for TCP
161+
162+
2017-03-02: Joel Cunningham
163+
* netconn/sockets: vectorize netconn_write for TCP, treating a vectored I/O write
164+
atomically in regards to TCP segmentation (patch #8882)
165+
166+
2017-03-02: Simon Goldschmidt
167+
* netconn: added nonblocking accept/recv to netconn API (task #14396)
168+
169+
2017-02-28: Simon Goldschmidt
170+
* Added LWIP_SINGLE_NETIF for small targets with only one netif
171+
172+
2017-02-10: David van Moolenbroek
173+
* Implement UDP and RAW multicast support for IPv6 (core API, not netconn/sockets)
174+
175+
2017-02-04: David van Moolenbroek
176+
* IPv6 scopes support
177+
178+
2017-01-20: Joel Cunningham
179+
* sockets: add interface name/index APIs (task #14314)
180+
181+
2017-01-08: David van Moolenbroek
182+
* Extensions to RAW API (patch #9208)
183+
- Connected RAW PCBs
184+
- Add raw_sendto_if_src()
185+
- Support IP_HDRINCL socket option
186+
187+
++ Bugfixes:
188+
189+
2018-06-19: Simon Goldschmidt
190+
* tcp: fix RTO timer not working if link is down
191+
192+
2018-06-15: Sylvain Rochet
193+
* ppp: multiple smaller bugfixes
194+
195+
2018-05-17: Simon Goldschmidt
196+
* etharp: arp table can now be bigger than 127 entries
197+
198+
2018-04-25: Jens Nielsen
199+
* tftp server: correctly handle retransmissions
200+
201+
2018-04-18: Simon Goldschmidt
202+
sockets: fix race conditions when closing full-duplex sockets
203+
204+
2018-03-09: Simon Goldschmidt
205+
* 6lowpan: fix to work against contiki; added ZigBee encapsulation netif for tests
206+
207+
2018-02-04: Simon Goldschmidt
208+
* sockets: fix inconsistencies on close (inconsistent error codes, double FIN)
209+
210+
2018-01-05: Dirk Ziegelmeier
211+
* Fix bug #52748: the bug in timeouts.c by reimplementing timer logic to use
212+
absolute instead of relative timeout values
213+
214+
2017-12-31: Dirk Ziegelmeier
215+
* Fix bug #52704: DHCP and bad OFFER: Stop timeout only if offer is accepted
216+
217+
2017-11-08: Joel Cunningham
218+
* netif: ensure link and admin states are up in issue reports (bug #52353)
219+
220+
2017-09-12: David Lockyer
221+
* select: allocate select_cb from memp for LWIP_MPU_COMPATIBLE = 1 (bug #51990)
222+
223+
2017-09-11: Simon Goldschmidt
224+
* tcp_in.c: fix bug #51937 (leaking tcp_pcbs on passive close with unacked data)
225+
226+
2017-08-11: Joel Cunningham
227+
* lwip_itoa: fix converting the number 0 (previously converted to '\0') (bug #51729)
228+
229+
2017-08-08: Dirk Ziegelmeier
230+
* ip4_route_src: parameter order is reversed: ip4_route_src(dest, src) -> ip4_route_src(src, dest)
231+
to make parameter order consistent with other ip*_route*() functions
232+
Same also applies to LWIP_HOOK_IP4_ROUTE_SRC() parameter order.
233+
234+
2017-08-04: Joel Cunningham
235+
* tcp: re-work persist timer to fully close window (details in bug #50837)
236+
237+
2017-07-26: Simon Goldschmidt
238+
* snmp_msg.c: fix bug #51578 (SNMP failed to decode some values on non 32bit platforms)
239+
240+
2017-07-20: Simon Goldschmidt
241+
* compatibility headers: moved from 'src/include/posix' to 'src/include/compat/posix',
242+
'src/include/compat/stdc' etc.
243+
244+
2017-05-09: Joel Cunningham
245+
* tcp: add zero-window probe timeout (bug #50837)
246+
247+
2017-04-11: Simon Goldschmidt
248+
* sockets.c: task #14420 (Remove sys_sem_signal from inside SYS_ARCH_PROTECT
249+
crit section) done for LWIP_TCPIP_CORE_LOCKING==1
250+
251+
2017-02-24: Simon Goldschmidt
252+
* sockets.c: fixed close race conditions in lwip_select (for LWIP_NETCONN_FULLDUPLEX)
253+
254+
2017-02-24: Simon Goldschmidt
255+
* sockets.c: fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392)
256+
257+
2017-01-11: David van Moolenbroek
258+
* Lots of IPv6 related fixes and improvements
259+
260+
(STABLE-2.0.3)
261+
262+
++ Bugfixes:
263+
264+
2017-09-11: Simon Goldschmidt
265+
* tcp_in.c: fix bug #51937 (leaking tcp_pcbs on passive close with unacked data)
266+
267+
2017-08-02: Abroz Bizjak/Simon Goldschmidt
268+
* multiple fixes in IPv4 reassembly (leading to corrupted datagrams received)
269+
270+
2017-03-30: Simon Goldschmidt
271+
* dhcp.c: return ERR_VAL instead of asserting on offset-out-of-pbuf
272+
273+
2017-03-23: Dirk Ziegelmeier
274+
* dhcp.h: fix bug #50618 (dhcp_remove_struct() macro does not work)
275+
7276
(STABLE-2.0.2)
8277

9278
++ New features:
@@ -13,10 +282,10 @@ HISTORY
13282
We now have a #define for a header file name that is #included in every .c
14283
file that provides hooks.
15284

16-
++ Bugfixes:
285+
2017-02-10: Simon Goldschmidt
286+
* tcp_close does not fail on memory error (instead, FIN is sent from tcp_tmr)
17287

18-
2017-01-11: David van Moolenbroek
19-
* Lots of IPv6 related fixes and improvements
288+
++ Bugfixes:
20289

21290
2017-03-08
22291
* tcp: do not keep sending SYNs when getting ACKs

features/lwipstack/lwip/FEATURES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lwIP is a small independent implementation of the TCP/IP protocol suite targeted at embedded systems.
2+
3+
The focus of the lwIP TCP/IP implementation is to reduce resource usage while still having a full scale TCP. This makes lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM.
4+
5+
Main features include:
6+
- Protocols: IP, IPv6, ICMP, ND, MLD, UDP, TCP, IGMP, ARP, PPPoS, PPPoE, 6LowPAN (via IEEE 802.15.4, BLE or ZEP; since v2.1.0)
7+
- DHCP client, stateless DHCPv6 (since v2.1.0), DNS client (incl. mDNS hostname resolver), AutoIP/APIPA (Zeroconf), SNMP agent (v1, v2c, v3 (since v2.1.0), private MIB support & MIB compiler)
8+
- APIs: specialized APIs for enhanced performance & zero copy, optional Berkeley-alike socket API
9+
- Extended features: IP forwarding over multiple network interfaces
10+
- Extended TCP features: congestion control, RTT estimation and fast recovery/fast retransmit, sending SACKs (since v2.1.0), "altcp": nearly transparent TLS for any tcp pcb (since v2.1.0)
11+
- Addon applications: HTTP server (HTTPS via altcp), HTTP(S) client (since v2.1.0), SNTP client, SMTP client (SMTPS via altcp), ping, NetBIOS nameserver, mDNS responder, MQTT client (TLS support since v2.1.0), TFTP server, iPerf2 counterpart

0 commit comments

Comments
 (0)