1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

update to lwIP-2.1.0: partial SACK support by default (de-selectable in menu) (#5126)

* update to lwIP-2.1.0rc1: partial SACK support
fix #4176

* hash fix

* get some flash back due to mistake in conf (fragmentation & reassembly was incorrectly enabled)
(ahah I scared you)

* add missing include files

* update to lwip-2.1.0(release) + remove unused lwIP's include files

* lwIP release 2.1.0, SACK is now default, bigger, no-SACK is selectable

* fix ldscript

* pio

* rename 'sack' option to 'feat'ure option, + IP fragmentation/reassembly

* merge, fix pio

* change internal/hidden string

* pio: more lwip2 configuration: + without sack for no change in flash footprint
This commit is contained in:
david gauchard
2018-10-09 21:27:27 +02:00
committed by Develo
parent 3c13751bcf
commit a1e59e9c01
130 changed files with 4743 additions and 9212 deletions

View File

@ -54,24 +54,34 @@ extern "C" {
#if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */
/** IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, this needs to
* be enabled (to not overwrite part of the data). When enabled, the IPv6 header
* is copied instead of referencing it, which gives more room for struct ip6_reass_helper */
/** The IPv6 reassembly timer interval in milliseconds. */
#define IP6_REASS_TMR_INTERVAL 1000
/** IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, "struct
* ip6_reass_helper" is too large to be stored in the IPv6 fragment header, and
* will bleed into the header before it, which may be the IPv6 header or an
* extension header. This means that for each first fragment packet, we need to
* 1) make a copy of some IPv6 header fields (src+dest) that we need later on,
* just in case we do overwrite part of the IPv6 header, and 2) make a copy of
* the header data that we overwrote, so that we can restore it before either
* completing reassembly or sending an ICMPv6 reply. The last part is true even
* if this setting is disabled, but if it is enabled, we need to save a bit
* more data (up to the size of a pointer) because we overwrite more. */
#ifndef IPV6_FRAG_COPYHEADER
#define IPV6_FRAG_COPYHEADER 0
#endif
/** The IPv6 reassembly timer interval in milliseconds. */
#define IP6_REASS_TMR_INTERVAL 1000
/* Copy the complete header of the first fragment to struct ip6_reassdata
or just point to its original location in the first pbuf? */
/* With IPV6_FRAG_COPYHEADER==1, a helper structure may (or, depending on the
* presence of extensions, may not) overwrite part of the IP header. Therefore,
* we copy the fields that we need from the IP header for as long as the helper
* structure may still be in place. This is easier than temporarily restoring
* those fields in the IP header each time we need to perform checks on them. */
#if IPV6_FRAG_COPYHEADER
#define IPV6_FRAG_HDRPTR
#define IPV6_FRAG_HDRREF(hdr) (&(hdr))
#define IPV6_FRAG_SRC(ipr) ((ipr)->src)
#define IPV6_FRAG_DEST(ipr) ((ipr)->dest)
#else /* IPV6_FRAG_COPYHEADER */
#define IPV6_FRAG_HDRPTR *
#define IPV6_FRAG_HDRREF(hdr) (hdr)
#define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
#define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
#endif /* IPV6_FRAG_COPYHEADER */
/** IPv6 reassembly helper struct.
@ -80,11 +90,25 @@ extern "C" {
struct ip6_reassdata {
struct ip6_reassdata *next;
struct pbuf *p;
struct ip6_hdr IPV6_FRAG_HDRPTR iphdr;
struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */
#if IPV6_FRAG_COPYHEADER
ip6_addr_p_t src; /* copy of the source address in the IP header */
ip6_addr_p_t dest; /* copy of the destination address in the IP header */
/* This buffer (for the part of the original header that we overwrite) will
* be slightly oversized, but we cannot compute the exact size from here. */
u8_t orig_hdr[sizeof(struct ip6_frag_hdr) + sizeof(void*)];
#else /* IPV6_FRAG_COPYHEADER */
/* In this case we still need the buffer, for sending ICMPv6 replies. */
u8_t orig_hdr[sizeof(struct ip6_frag_hdr)];
#endif /* IPV6_FRAG_COPYHEADER */
u32_t identification;
u16_t datagram_len;
u8_t nexth;
u8_t timer;
#if LWIP_IPV6_SCOPES
u8_t src_zone; /* zone of original packet's source address */
u8_t dest_zone; /* zone of original packet's destination address */
#endif /* LWIP_IPV6_SCOPES */
};
#define ip6_reass_init() /* Compatibility define */