xref: /btstack/3rd-party/lwip/core/UPGRADING (revision 97dc5e692c7d94a280158af58036a0efee5b0e56)
1*97dc5e69SMatthias RingwaldThis file lists major changes between release versions that require
2*97dc5e69SMatthias Ringwaldports or applications to be changed. Use it to update a port or an
3*97dc5e69SMatthias Ringwaldapplication written for an older version of lwIP to correctly work
4*97dc5e69SMatthias Ringwaldwith newer versions.
5*97dc5e69SMatthias Ringwald
6*97dc5e69SMatthias Ringwald
7*97dc5e69SMatthias Ringwald(git master)
8*97dc5e69SMatthias Ringwald
9*97dc5e69SMatthias Ringwald  * [Enter new changes just after this line - do not remove this line]
10*97dc5e69SMatthias Ringwald
11*97dc5e69SMatthias Ringwald(2.1.0)
12*97dc5e69SMatthias Ringwald
13*97dc5e69SMatthias Ringwald  ++ Application changes:
14*97dc5e69SMatthias Ringwald
15*97dc5e69SMatthias Ringwald  * Use the new altcp API for seamless TLS integration into existing TCP applications (see changelog)
16*97dc5e69SMatthias Ringwald  * TCP only kills existing connections with a LOWER priority than the one currently being opened.
17*97dc5e69SMatthias Ringwald    Previous implementations also kill existing connections of the SAME priority.
18*97dc5e69SMatthias Ringwald  * ip4_route_src: parameter order is reversed: ip4_route_src(dest, src) -> ip4_route_src(src, dest)
19*97dc5e69SMatthias Ringwald    to make parameter order consistent with other ip*_route*() functions.
20*97dc5e69SMatthias Ringwald    Same also applies to LWIP_HOOK_IP4_ROUTE_SRC() parameter order.
21*97dc5e69SMatthias Ringwald  * pbuf API: pbuf->type (an u8_t holding the enum 'pbuf_type') has changed to only hold a
22*97dc5e69SMatthias Ringwald    description of the pbuf (e.g. data following pbuf struct, data volatile, allocation
23*97dc5e69SMatthias Ringwald    source heap/pool/etc.). As a consequence, applications can't test pbuf->type any more.
24*97dc5e69SMatthias Ringwald    Use pbuf_match_type(pbuf, type) instead.
25*97dc5e69SMatthias Ringwald  * socket API: according to the standard, SO_ERROR now only returns asynchronous errors.
26*97dc5e69SMatthias Ringwald    All other/normal/synchronous errors are (and always were) available via 'errno'.
27*97dc5e69SMatthias Ringwald    LWIP_SOCKET_SET_ERRNO has been removed - 'errno' is always set - and required!
28*97dc5e69SMatthias Ringwald  * httpd LWIP_HTTPD_CGI_SSI: httpd_cgi_handler() has an additional parameter "struct fs_file *"
29*97dc5e69SMatthias Ringwald
30*97dc5e69SMatthias Ringwald  ++ Port changes:
31*97dc5e69SMatthias Ringwald
32*97dc5e69SMatthias Ringwald  * tcpip_trycallback() was renamed to tcpip_callbackmsg_trycallback() to avoid confusion
33*97dc5e69SMatthias Ringwald    with tcpip_try_callback()
34*97dc5e69SMatthias Ringwald  * compatibility headers: moved from 'src/include/posix' to 'src/include/compat/posix',
35*97dc5e69SMatthias Ringwald    'src/include/compat/stdc' etc.
36*97dc5e69SMatthias Ringwald  * The IPv6 implementation now supports address scopes. (See LWIP_IPV6_SCOPES documentation
37*97dc5e69SMatthias Ringwald    and ip6_zone.h for more documentation)
38*97dc5e69SMatthias Ringwald  * LWIP_HOOK_DHCP_APPEND_OPTIONS() has changed, see description in opt.h (options_out_len is not
39*97dc5e69SMatthias Ringwald    available in struct dhcp any more)
40*97dc5e69SMatthias Ringwald  * Added debug helper asserts to ensure threading/locking requirements are met (define
41*97dc5e69SMatthias Ringwald    LWIP_MARK_TCPIP_THREAD() and LWIP_ASSERT_CORE_LOCKED()).
42*97dc5e69SMatthias Ringwald  * Added sys_mbox_trypost_fromisr() and tcpip_callbackmsg_trycallback_fromisr()
43*97dc5e69SMatthias Ringwald    These can be used to post preallocated messages from an ISR to the tcpip thread
44*97dc5e69SMatthias Ringwald    (e.g. when using FreeRTOS)
45*97dc5e69SMatthias Ringwald
46*97dc5e69SMatthias Ringwald(2.0.2)
47*97dc5e69SMatthias Ringwald
48*97dc5e69SMatthias Ringwald  ++ Application changes:
49*97dc5e69SMatthias Ringwald
50*97dc5e69SMatthias Ringwald  * slipif: The way to pass serial port number has changed. netif->num is not
51*97dc5e69SMatthias Ringwald    supported any more, netif->state is interpreted as an u8_t port number now
52*97dc5e69SMatthias Ringwald    (it's not a POINTER to an u8_t any more!)
53*97dc5e69SMatthias Ringwald
54*97dc5e69SMatthias Ringwald(2.0.1)
55*97dc5e69SMatthias Ringwald
56*97dc5e69SMatthias Ringwald  ++ Application changes:
57*97dc5e69SMatthias Ringwald
58*97dc5e69SMatthias Ringwald  * UDP does NOT receive multicast traffic from ALL netifs on an UDP PCB bound to a specific
59*97dc5e69SMatthias Ringwald    netif any more. Users need to bind to IP_ADDR_ANY to receive multicast traffic and compare
60*97dc5e69SMatthias Ringwald    ip_current_netif() to the desired netif for every packet.
61*97dc5e69SMatthias Ringwald    See bug #49662 for an explanation.
62*97dc5e69SMatthias Ringwald
63*97dc5e69SMatthias Ringwald(2.0.0)
64*97dc5e69SMatthias Ringwald
65*97dc5e69SMatthias Ringwald  ++ Application changes:
66*97dc5e69SMatthias Ringwald
67*97dc5e69SMatthias Ringwald  * Changed netif "up" flag handling to be an administrative flag (as opposed to the previous meaning of
68*97dc5e69SMatthias Ringwald    "ip4-address-valid", a netif will now not be used for transmission if not up) -> even a DHCP netif
69*97dc5e69SMatthias Ringwald    has to be set "up" before starting the DHCP client
70*97dc5e69SMatthias Ringwald  * Added IPv6 support (dual-stack or IPv4/IPv6 only)
71*97dc5e69SMatthias Ringwald  * Changed ip_addr_t to be a union in dual-stack mode (use ip4_addr_t where referring to IPv4 only).
72*97dc5e69SMatthias Ringwald  * Major rewrite of SNMP (added MIB parser that creates code stubs for custom MIBs);
73*97dc5e69SMatthias Ringwald    supports SNMPv2c (experimental v3 support)
74*97dc5e69SMatthias Ringwald  * Moved some core applications from contrib repository to src/apps (and include/lwip/apps)
75*97dc5e69SMatthias Ringwald
76*97dc5e69SMatthias Ringwald  +++ Raw API:
77*97dc5e69SMatthias Ringwald    * Changed TCP listen backlog: removed tcp_accepted(), added the function pair tcp_backlog_delayed()/
78*97dc5e69SMatthias Ringwald      tcp_backlog_accepted() to explicitly delay backlog handling on a connection pcb
79*97dc5e69SMatthias Ringwald
80*97dc5e69SMatthias Ringwald  +++ Socket API:
81*97dc5e69SMatthias Ringwald    * Added an implementation for posix sendmsg()
82*97dc5e69SMatthias Ringwald    * Added LWIP_FIONREAD_LINUXMODE that makes ioctl/FIONREAD return the size of the next pending datagram
83*97dc5e69SMatthias Ringwald
84*97dc5e69SMatthias Ringwald  ++ Port changes
85*97dc5e69SMatthias Ringwald
86*97dc5e69SMatthias Ringwald  +++ new files:
87*97dc5e69SMatthias Ringwald    * MANY new and moved files!
88*97dc5e69SMatthias Ringwald    * Added src/Filelists.mk for use in Makefile projects
89*97dc5e69SMatthias Ringwald    * Continued moving stack-internal parts from abc.h to abc_priv.h in sub-folder "priv"
90*97dc5e69SMatthias Ringwald      to let abc.h only contain the actual application programmer's API
91*97dc5e69SMatthias Ringwald
92*97dc5e69SMatthias Ringwald  +++ sys layer:
93*97dc5e69SMatthias Ringwald    * Made LWIP_TCPIP_CORE_LOCKING==1 the default as it usually performs better than
94*97dc5e69SMatthias Ringwald      the traditional message passing (although with LWIP_COMPAT_MUTEX you are still
95*97dc5e69SMatthias Ringwald      open to priority inversion, so this is not recommended any more)
96*97dc5e69SMatthias Ringwald    * Added LWIP_NETCONN_SEM_PER_THREAD to use one "op_completed" semaphore per thread
97*97dc5e69SMatthias Ringwald      instead of using one per netconn (these semaphores are used even with core locking
98*97dc5e69SMatthias Ringwald      enabled as some longer lasting functions like big writes still need to delay)
99*97dc5e69SMatthias Ringwald    * Added generalized abstraction for itoa(), strnicmp(), stricmp() and strnstr()
100*97dc5e69SMatthias Ringwald      in def.h (to be overridden in cc.h) instead of config
101*97dc5e69SMatthias Ringwald      options for netbiosns, httpd, dns, etc. ...
102*97dc5e69SMatthias Ringwald    * New abstraction for hton* and ntoh* functions in def.h.
103*97dc5e69SMatthias Ringwald      To override them, use the following in cc.h:
104*97dc5e69SMatthias Ringwald      #define lwip_htons(x) <your_htons>
105*97dc5e69SMatthias Ringwald      #define lwip_htonl(x) <your_htonl>
106*97dc5e69SMatthias Ringwald
107*97dc5e69SMatthias Ringwald  +++ new options:
108*97dc5e69SMatthias Ringwald     * TODO
109*97dc5e69SMatthias Ringwald
110*97dc5e69SMatthias Ringwald  +++ new pools:
111*97dc5e69SMatthias Ringwald     * Added LWIP_MEMPOOL_* (declare/init/alloc/free) to declare private memp pools
112*97dc5e69SMatthias Ringwald       that share memp.c code but do not have to be made global via lwippools.h
113*97dc5e69SMatthias Ringwald     * Added pools for IPv6, MPU_COMPATIBLE, dns-api, netif-api, etc.
114*97dc5e69SMatthias Ringwald     * added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when a memp pool was empty and an item
115*97dc5e69SMatthias Ringwald       is now available
116*97dc5e69SMatthias Ringwald
117*97dc5e69SMatthias Ringwald  * Signature of LWIP_HOOK_VLAN_SET macro was changed
118*97dc5e69SMatthias Ringwald
119*97dc5e69SMatthias Ringwald  * LWIP_DECLARE_MEMORY_ALIGNED() may be used to declare aligned memory buffers (mem/memp)
120*97dc5e69SMatthias Ringwald    or to move buffers to dedicated memory using compiler attributes
121*97dc5e69SMatthias Ringwald
122*97dc5e69SMatthias Ringwald  * Standard C headers are used to define sized types and printf formatters
123*97dc5e69SMatthias Ringwald    (disable by setting LWIP_NO_STDINT_H=1 or LWIP_NO_INTTYPES_H=1 if your compiler
124*97dc5e69SMatthias Ringwald    does not support these)
125*97dc5e69SMatthias Ringwald
126*97dc5e69SMatthias Ringwald
127*97dc5e69SMatthias Ringwald  ++ Major bugfixes/improvements
128*97dc5e69SMatthias Ringwald
129*97dc5e69SMatthias Ringwald  * Added IPv6 support (dual-stack or IPv4/IPv6 only)
130*97dc5e69SMatthias Ringwald  * Major rewrite of PPP (incl. keep-up with apache pppd)
131*97dc5e69SMatthias Ringwald    see doc/ppp.txt for an upgrading how-to
132*97dc5e69SMatthias Ringwald  * Major rewrite of SNMP (incl. MIB parser)
133*97dc5e69SMatthias Ringwald  * Fixed timing issues that might have lead to losing a DHCP lease
134*97dc5e69SMatthias Ringwald  * Made rx processing path more robust against crafted errors
135*97dc5e69SMatthias Ringwald  * TCP window scaling support
136*97dc5e69SMatthias Ringwald  * modification of api modules to support FreeRTOS-MPU (don't pass stack-pointers to other threads)
137*97dc5e69SMatthias Ringwald  * made DNS client more robust
138*97dc5e69SMatthias Ringwald  * support PBUF_REF for RX packets
139*97dc5e69SMatthias Ringwald  * LWIP_NETCONN_FULLDUPLEX allows netconn/sockets to be used for reading/writing from separate
140*97dc5e69SMatthias Ringwald    threads each (needs LWIP_NETCONN_SEM_PER_THREAD)
141*97dc5e69SMatthias Ringwald  * Moved and reordered stats (mainly memp/mib2)
142*97dc5e69SMatthias Ringwald
143*97dc5e69SMatthias Ringwald(1.4.0)
144*97dc5e69SMatthias Ringwald
145*97dc5e69SMatthias Ringwald  ++ Application changes:
146*97dc5e69SMatthias Ringwald
147*97dc5e69SMatthias Ringwald  * Replaced struct ip_addr by typedef ip_addr_t (struct ip_addr is kept for
148*97dc5e69SMatthias Ringwald    compatibility to old applications, but will be removed in the future).
149*97dc5e69SMatthias Ringwald
150*97dc5e69SMatthias Ringwald  * Renamed mem_realloc() to mem_trim() to prevent confusion with realloc()
151*97dc5e69SMatthias Ringwald
152*97dc5e69SMatthias Ringwald  +++ Raw API:
153*97dc5e69SMatthias Ringwald    * Changed the semantics of tcp_close() (since it was rather a
154*97dc5e69SMatthias Ringwald      shutdown before): Now the application does *NOT* get any calls to the recv
155*97dc5e69SMatthias Ringwald      callback (aside from NULL/closed) after calling tcp_close()
156*97dc5e69SMatthias Ringwald
157*97dc5e69SMatthias Ringwald    * When calling tcp_abort() from a raw API TCP callback function,
158*97dc5e69SMatthias Ringwald      make sure you return ERR_ABRT to prevent accessing unallocated memory.
159*97dc5e69SMatthias Ringwald      (ERR_ABRT now means the applicaiton has called tcp_abort!)
160*97dc5e69SMatthias Ringwald
161*97dc5e69SMatthias Ringwald  +++ Netconn API:
162*97dc5e69SMatthias Ringwald    * Changed netconn_receive() and netconn_accept() to return
163*97dc5e69SMatthias Ringwald      err_t, not a pointer to new data/netconn.
164*97dc5e69SMatthias Ringwald
165*97dc5e69SMatthias Ringwald  +++ Socket API:
166*97dc5e69SMatthias Ringwald    * LWIP_SO_RCVTIMEO: when accept() or recv() time out, they
167*97dc5e69SMatthias Ringwald      now set errno to EWOULDBLOCK/EAGAIN, not ETIMEDOUT.
168*97dc5e69SMatthias Ringwald
169*97dc5e69SMatthias Ringwald    * Added a minimal version of posix fctl() to have a
170*97dc5e69SMatthias Ringwald      standardised way to set O_NONBLOCK for nonblocking sockets.
171*97dc5e69SMatthias Ringwald
172*97dc5e69SMatthias Ringwald  +++ all APIs:
173*97dc5e69SMatthias Ringwald    * correctly implemented SO(F)_REUSEADDR
174*97dc5e69SMatthias Ringwald
175*97dc5e69SMatthias Ringwald  ++ Port changes
176*97dc5e69SMatthias Ringwald
177*97dc5e69SMatthias Ringwald  +++ new files:
178*97dc5e69SMatthias Ringwald
179*97dc5e69SMatthias Ringwald    * Added 4 new files: def.c, timers.c, timers.h, tcp_impl.h:
180*97dc5e69SMatthias Ringwald
181*97dc5e69SMatthias Ringwald    * Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains
182*97dc5e69SMatthias Ringwald      the actual application programmer's API
183*97dc5e69SMatthias Ringwald
184*97dc5e69SMatthias Ringwald    * Separated timer implementation from sys.h/.c, moved to timers.h/.c;
185*97dc5e69SMatthias Ringwald      Added timer implementation for NO_SYS==1, set NO_SYS_NO_TIMERS==1 if you
186*97dc5e69SMatthias Ringwald      still want to use your own timer implementation for NO_SYS==0 (as before).
187*97dc5e69SMatthias Ringwald
188*97dc5e69SMatthias Ringwald  +++ sys layer:
189*97dc5e69SMatthias Ringwald
190*97dc5e69SMatthias Ringwald    * Converted mbox- and semaphore-functions to take pointers to sys_mbox_t/
191*97dc5e69SMatthias Ringwald      sys_sem_t;
192*97dc5e69SMatthias Ringwald
193*97dc5e69SMatthias Ringwald    * Converted sys_mbox_new/sys_sem_new to take pointers and return err_t;
194*97dc5e69SMatthias Ringwald
195*97dc5e69SMatthias Ringwald    * Added Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX to let sys.h use
196*97dc5e69SMatthias Ringwald      binary semaphores instead of mutexes - as before)
197*97dc5e69SMatthias Ringwald
198*97dc5e69SMatthias Ringwald  +++ new options:
199*97dc5e69SMatthias Ringwald
200*97dc5e69SMatthias Ringwald     * Don't waste memory when chaining segments, added option TCP_OVERSIZE to
201*97dc5e69SMatthias Ringwald       prevent creating many small pbufs when calling tcp_write with many small
202*97dc5e69SMatthias Ringwald       blocks of data. Instead, pbufs are allocated larger than needed and the
203*97dc5e69SMatthias Ringwald       space is used for later calls to tcp_write.
204*97dc5e69SMatthias Ringwald
205*97dc5e69SMatthias Ringwald     * Added LWIP_NETIF_TX_SINGLE_PBUF to always copy to try to create single pbufs
206*97dc5e69SMatthias Ringwald       in tcp_write/udp_send.
207*97dc5e69SMatthias Ringwald
208*97dc5e69SMatthias Ringwald    * Added an additional option LWIP_ETHERNET to support ethernet without ARP
209*97dc5e69SMatthias Ringwald      (necessary for pure PPPoE)
210*97dc5e69SMatthias Ringwald
211*97dc5e69SMatthias Ringwald    * Add MEMP_SEPARATE_POOLS to place memory pools in separate arrays. This may
212*97dc5e69SMatthias Ringwald      be used to place these pools into user-defined memory by using external
213*97dc5e69SMatthias Ringwald      declaration.
214*97dc5e69SMatthias Ringwald
215*97dc5e69SMatthias Ringwald    * Added TCP_SNDQUEUELOWAT corresponding to TCP_SNDLOWAT
216*97dc5e69SMatthias Ringwald
217*97dc5e69SMatthias Ringwald  +++ new pools:
218*97dc5e69SMatthias Ringwald
219*97dc5e69SMatthias Ringwald     * Netdb uses a memp pool for allocating memory when getaddrinfo() is called,
220*97dc5e69SMatthias Ringwald       so MEMP_NUM_NETDB has to be set accordingly.
221*97dc5e69SMatthias Ringwald
222*97dc5e69SMatthias Ringwald     * DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses a memp pool instead of the heap, so
223*97dc5e69SMatthias Ringwald       MEMP_NUM_LOCALHOSTLIST has to be set accordingly.
224*97dc5e69SMatthias Ringwald
225*97dc5e69SMatthias Ringwald     * Snmp-agent uses a memp pools instead of the heap, so MEMP_NUM_SNMP_* have
226*97dc5e69SMatthias Ringwald       to be set accordingly.
227*97dc5e69SMatthias Ringwald
228*97dc5e69SMatthias Ringwald     * PPPoE uses a MEMP pool instead of the heap, so MEMP_NUM_PPPOE_INTERFACES
229*97dc5e69SMatthias Ringwald       has to be set accordingly
230*97dc5e69SMatthias Ringwald
231*97dc5e69SMatthias Ringwald  * Integrated loopif into netif.c - loopif does not have to be created by the
232*97dc5e69SMatthias Ringwald    port any more, just define LWIP_HAVE_LOOPIF to 1.
233*97dc5e69SMatthias Ringwald
234*97dc5e69SMatthias Ringwald  * Added define LWIP_RAND() for lwip-wide randomization (needs to be defined
235*97dc5e69SMatthias Ringwald    in cc.h, e.g. used by igmp)
236*97dc5e69SMatthias Ringwald
237*97dc5e69SMatthias Ringwald  * Added printf-formatter X8_F to printf u8_t as hex
238*97dc5e69SMatthias Ringwald
239*97dc5e69SMatthias Ringwald  * The heap now may be moved to user-defined memory by defining
240*97dc5e69SMatthias Ringwald    LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address
241*97dc5e69SMatthias Ringwald
242*97dc5e69SMatthias Ringwald  * added autoip_set_struct() and dhcp_set_struct() to let autoip and dhcp work
243*97dc5e69SMatthias Ringwald    with user-allocated structs instead of calling mem_malloc
244*97dc5e69SMatthias Ringwald
245*97dc5e69SMatthias Ringwald  * Added const char* name to mem- and memp-stats for easier debugging.
246*97dc5e69SMatthias Ringwald
247*97dc5e69SMatthias Ringwald  * Calculate the TCP/UDP checksum while copying to only fetch data once:
248*97dc5e69SMatthias Ringwald    Define LWIP_CHKSUM_COPY to a memcpy-like function that returns the checksum
249*97dc5e69SMatthias Ringwald
250*97dc5e69SMatthias Ringwald  * Added SO_REUSE_RXTOALL to pass received UDP broadcast/multicast packets to
251*97dc5e69SMatthias Ringwald    more than one pcb.
252*97dc5e69SMatthias Ringwald
253*97dc5e69SMatthias Ringwald  * Changed the semantics of ARP_QUEUEING==0: ARP_QUEUEING now cannot be turned
254*97dc5e69SMatthias Ringwald    off any more, if this is set to 0, only one packet (the most recent one) is
255*97dc5e69SMatthias Ringwald    queued (like demanded by RFC 1122).
256*97dc5e69SMatthias Ringwald
257*97dc5e69SMatthias Ringwald
258*97dc5e69SMatthias Ringwald  ++ Major bugfixes/improvements
259*97dc5e69SMatthias Ringwald
260*97dc5e69SMatthias Ringwald  * Implemented tcp_shutdown() to only shut down one end of a connection
261*97dc5e69SMatthias Ringwald  * Implemented shutdown() at socket- and netconn-level
262*97dc5e69SMatthias Ringwald  * Added errorset support to select() + improved select speed overhead
263*97dc5e69SMatthias Ringwald  * Merged pppd to v2.3.11 (including some backported bugfixes from 2.4.x)
264*97dc5e69SMatthias Ringwald  * Added timer implementation for NO_SYS==1 (may be disabled with NO_SYS_NO_TIMERS==1
265*97dc5e69SMatthias Ringwald  * Use macros defined in ip_addr.h to work with IP addresses
266*97dc5e69SMatthias Ringwald  * Implemented many nonblocking socket/netconn functions
267*97dc5e69SMatthias Ringwald  * Fixed ARP input processing: only add a new entry if a request was directed as us
268*97dc5e69SMatthias Ringwald  * mem_realloc() to mem_trim() to prevent confusion with realloc()
269*97dc5e69SMatthias Ringwald  * Some improvements for AutoIP (don't route/forward link-local addresses, don't break
270*97dc5e69SMatthias Ringwald    existing connections when assigning a routable address)
271*97dc5e69SMatthias Ringwald  * Correctly handle remote side overrunning our rcv_wnd in ooseq case
272*97dc5e69SMatthias Ringwald  * Removed packing from ip_addr_t, the packed version is now only used in protocol headers
273*97dc5e69SMatthias Ringwald  * Corrected PBUF_POOL_BUFSIZE for ports where ETH_PAD_SIZE > 0
274*97dc5e69SMatthias Ringwald  * Added support for static ARP table entries
275*97dc5e69SMatthias Ringwald
276*97dc5e69SMatthias Ringwald(STABLE-1.3.2)
277*97dc5e69SMatthias Ringwald
278*97dc5e69SMatthias Ringwald  * initial version of this file
279