History log of /seL4-camkes-master/projects/lwip/src/core/ipv6/ip6_frag.c
Revision Date Author Comments
# eeb2218b 18-Jul-2018 Dirk Ziegelmeier <dziegelmeier@de.pepperl-fuchs.com>

Revert "Test / RFC: Reformat a few files using clang-format"

This reverts commit 8b4a8159a898795ef0fc9226dae1ce66531ad487.

We do not want to do this shortly before a release. Reformatting (buggy reformatting) may introduce new bugs.


# 8b4a8159 17-Jul-2018 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Test / RFC: Reformat a few files using clang-format

Does it compile? Does it look good (enough)?


# 27b7ed17 16-Sep-2017 Jisu Kim <bossrlawltn@naver.com>

First step to passing IPV6 Ready test: time out IPv6 fragments after 60 seconds
(added IPV6_REASS_MAXAGE as an option that is independent of the IPv4 setting)

Signed-off-by: goldsimon <goldsimon@gmx.de>


# a1c7924c 04-Aug-2017 goldsimon <goldsimon@gmx.de>

task #14597: cleanup pbuf_header usages (use pbuf_add_header/pbuf_remove_header instead)


# 2781d7ab 01-Aug-2017 Axel Lin <axel.lin@ingics.com>

ip6_reass: Move update ip6_frag.drop stats to nullreturn

The ip6_frag.drop counter is updated before all the code paths calling
goto nullreturn, so let's move updating ip6_frag.drop stats to nullreturn.

Signed-off-by: Axel Lin <axel.lin@ingics.com>


# b8ecfe64 05-Jul-2017 goldsimon <goldsimon@gmx.de>

work on -Wconversion...


# 29ddfd1d 23-Jan-2017 David van Moolenbroek <david@minix3.org>

Add support for IPv6 address scopes

This patch adds full support for IPv6 address scopes, thereby aiming
to be compliant with IPv6 standards in general and RFC 4007 in
particular. The high-level summary is that link-local addresses are
now meaningful only in the context of their own link, guaranteeing
full isolation between links (and their addresses) in this respect.
This isolation even allows multiple interfaces to have the same
link-local addresses locally assigned.

The implementation achieves this by extending the lwIP IPv6 address
structure with a zone field that, for addresses that have a scope,
carries the scope's zone in which that address has meaning. The zone
maps to one or more interfaces. By default, lwIP uses a policy that
provides a 1:1 mapping between links and interfaces, and considers
all other addresses unscoped, corresponding to the default policy
sketched in RFC 4007 Sec. 6. The implementation allows for replacing
the default policy with a custom policy if desired, though.

The lwIP core implementation has been changed to provide somewhat of
a balance between correctness and efficiency on on side, and backward
compatibility on the other. In particular, while the application would
ideally always provide a zone for a scoped address, putting this in as
a requirement would likely break many applications. Instead, the API
accepts both "properly zoned" IPv6 addresses and addresses that, while
scoped, "lack" a zone. lwIP will try to add a zone as soon as possible
for efficiency reasons, in particular from TCP/UDP/RAW PCB bind and
connect calls, but this may fail, and sendto calls may bypass that
anyway. Ultimately, a zone is always added when an IP packet is sent
when needed, because the link-layer lwIP code (and ND6 in particualar)
requires that all addresses be properly zoned for correctness: for
example, to provide isolation between links in the ND6 destination
cache. All this applies to packet output only, because on packet
input, all scoped addresses will be given a zone automatically.

It is also worth remarking that on output, no attempt is made to stop
outgoing packets with addresses for a zone not matching the outgoing
interface. However, unless the application explicitly provides
addresses that will result in such zone violations, the core API
implementation (and the IPv6 routing algorithm in particular) itself
will never take decisions that result in zone violations itself.

This patch adds a new header file, ip6_zone.h, which contains comments
that explain several implementation aspects in a bit more detail.

For now, it is possible to disable scope support by changing the new
LWIP_IPV6_SCOPES configuration option. For users of the core API, it
is important to note that scoped addresses that are locally assigned
to a netif must always have a zone set; the standard netif address
assignment functions always do this on behalf of the caller, though.
Also, core API users will want to enable LWIP_IPV6_SCOPES_DEBUG at
least initially when upgrading, to ensure that all addresses are
properly initialized.


# 1d7f3759 14-Jan-2017 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix compile error in ip6_frag.c
../../../../lwip/src/core/ipv6/ip6_frag.c: In function ‘ip6_reass’:
../../../../lwip/src/core/ipv6/ip6_frag.c:567:7: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]


# 2c3538cb 11-Jan-2017 Axel Lin <axel.lin@ingics.com>

IPv6: Fix compile error of ip6_frag.c

Fix below compile error:
../../../../lwip/src/core/ipv6/ip6_frag.c: In function ‘ip6_reass’:
../../../../lwip/src/core/ipv6/ip6_frag.c:533:20: error: declaration of ‘next_pbuf’ shadows a previous local [-Werror=shadow]
struct pbuf* next_pbuf = iprh->next_pbuf;
^~~~~~~~~
../../../../lwip/src/core/ipv6/ip6_frag.c:272:20: note: shadowed declaration is here
struct pbuf *q, *next_pbuf;
^~~~~~~~~
cc1: all warnings being treated as errors
../Common.mk:93: recipe for target 'ip6_frag.o' failed
make: *** [ip6_frag.o] Error 1

Fixes: 7cedf7ae7133 ("IPv6: fragment reassembly fixes")
Signed-off-by: Axel Lin <axel.lin@ingics.com>


# 7cedf7ae 09-Jan-2017 David van Moolenbroek <david@minix3.org>

IPv6: fragment reassembly fixes

This patch aims to fix three closely related issues.

o The implementation of IPV6_FRAG_COPYHEADER was fundamentally
incompatible with the presence of extension headers between the
IPv6 header and the Fragment Header. This patch changes the
implementation to support such extension headers as well, with
pretty much the same memory requirements. As a result, we can
remove the check that prevented such packets from being reassembled
in all cases, even with IPV6_FRAG_COPYHEADER off.

o Given that temporary data is stored in the Fragment Header of
packets saved for the purpose of reassembly, but ICMPv6 "Fragment
Reassembly Time Exceeded" packets contain part of the original
packet, such ICMPv6 packets could actually end up containing part
of the temporary data, which may even include a pointer value. The
ICMPv6 packet should contain the original, unchanged packet, so
save the original header data before overwriting it even if
IPV6_FRAG_COPYHEADER is disabled. This does add some extra memory
consumption.

o Previously, the reassembly would leave the fragment header in the
reassembled packet, which is not permitted by RFC 2460 and prevents
reassembly of particularly large packets (close to 65535 bytes
after reassembly). This patch gets rid of the fragment header. It
does require an implementation of memmove() for that purpose.

Note that this patch aims to improve correctness. Future changes
might restore some of the previous functionality in order to regain
optimal performance for certain cases (at the cost of more code).


# e0c0ba7e 19-Dec-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix compile with LWIP_NOASSERT
Pointed out by Nirav Desai


# 26e02e84 09-Dec-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix bug #48963: ip6_frag does not support LWIP_NETIF_TX_SINGLE_PBUF
Implemented.


# f5f8ab5a 13-Oct-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix bug #49328: Crash error in ip6_frag due to Assertion Fail


# 13fb616b 05-Oct-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Cleanup hton*/ntoh* function handling and platform abstraction
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>


# 149701b3 30-Sep-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix bug #49218: pbuf_clen() overflow as a result of tcp_write concatenation
Let pbuf_clen() return u16_t


# bf3e8e6a 11-Aug-2016 goldsimon <goldsimon@gmx.de>

minor coding style fixes in IPv6 code


# 85ab3998 08-Aug-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Fix a few incorrect uses of err_t. Found by converting lwip error codes to an enum, but I'm not sure wether I want to commit the actual enum conversion.


# 8dc77ef5 22-Jun-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

doxygen updates - include IPv6 in documentation. Exclude include/netif/ppp/polarssl.
Convert TODO -> @todo


# fda778f6 16-Jun-2016 goldsimon <goldsimon@gmx.de>

ip6_reass: don't crash if frag header isn't the first (or not in the first pbuf)


# b401f425 07-Oct-2015 goldsimon <goldsimon@gmx.de>

minor: fixed coding style (lwip style)


# 2b971400 06-Oct-2015 sg <goldsimon@gmx.de>

minor: coding style


# 39e32ea7 17-Sep-2015 sg <goldsimon@gmx.de>

fixed const warning for !IPV6_FRAG_COPYHEADER


# f62022cd 17-Sep-2015 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Compiler warning fixes (mostly constness in dual-stack configurations)


# dd8feb49 31-Aug-2015 goldsimon <goldsimon@gmx.de>

PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required)


# ddba4b90 28-Aug-2015 Sylvain Rochet <gradator@gradator.net>

fixed typo: IP6_FRAG_COPYHEADER -> IPV6_FRAG_COPYHEADER


# bc8120c8 27-Aug-2015 sg <goldsimon@gmx.de>

Add another sanity check for bug #41009


# f6491725 26-Aug-2015 sg <goldsimon@gmx.de>

fixed bug bug #41009: IPv6 reassembly broken on 64-bit platforms: define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header instead of referencing it, which gives more room for struct ip6_reass_helper


# aad76acb 26-Aug-2015 sg <goldsimon@gmx.de>

IPV6_REASS: fix ip6_reass_remove_oldest_datagram() when the first fragment to enqueue has more pbufs than IP_REASS_MAX_PBUFS


# e60bc695 22-Apr-2015 goldsimon <goldsimon@gmx.de>

added more missing casts


# b4990b5b 22-Feb-2015 Sylvain Rochet <gradator@gradator.net>

Fixed warnings on whole project introduced by const pointers on ip_addr_t


# 33237419 18-Sep-2014 Simon Goldschmidt <goldsimon@gmx.de>

Parts of patch #8397 Typos corrected in comments and text outputs


# 142cc8fe 02-Sep-2014 Simon Goldschmidt <goldsimon@gmx.de>

minor: fixed a comment typo only


# c3ac8750 19-May-2014 Simon Goldschmidt <goldsimon@gmx.de>

Fixed typo-bug introduced some months ago while fixing bug #41041...


# f3110453 10-Jan-2014 Simon Goldschmidt <goldsimon@gmx.de>

Added an assert that should trigger bug #41009 (IPv6 reassembly broken on 64-bit platforms)


# 381a7b11 10-Jan-2014 Simon Goldschmidt <goldsimon@gmx.de>

fixed bug #41041 Potential use-after-free in IPv6 reassembly


# 8609d1e7 24-Apr-2013 Simon Goldschmidt <goldsimon@gmx.de>

fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h


# 8c954222 02-Mar-2012 Ivan Delamer <delamer@inicotech.com>

Early exit when checking if ip6 reassembled packet is valid.


# 34531a81 02-Mar-2012 Ivan Delamer <delamer@inicotech.com>

Check that pbuf_header succeeds in IPv6 reassembly.


# 629fad6f 17-Jun-2011 idelamer <idelamer>

Minor edits for for IPv6 compilation


# 90a03a77 17-May-2011 goldsimon <goldsimon>

Added new files for IPv6