Commit Graph

1999 Commits

Author SHA1 Message Date
Axel Lin
1a7ba24d13 memp: Fix memp_overflow_check_all failure
p needs to point to LWIP_MEM_ALIGN(memp_pools[i]->base) otherwise it will cause
assertion in overflow checking.

Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-11-04 20:16:24 +01:00
Erik Ekman
a82ec4499f memp: Check for null in memp_free
When memp_free_pool was split out from memp_free (c838e1ed5b),
the check for freeing the null pointer was lost.

This resulted in the null value being put back in the list of free
objects, causing all subsequent allocations of that type to fail.
2016-11-03 12:17:01 +01:00
Joel Cunningham
7d8989e3ea TCP documentation: fix tcp_pbuf_prealloc typo
This commit fixes a typo in the tcp_pbuf_prealloc documentation that
used "willo" in place of "will"
2016-11-02 14:10:20 -05:00
Dirk Ziegelmeier
5079e4552c Document non-standard functions in sys abstraction layer 2016-10-23 10:34:52 +02:00
David van Moolenbroek
760281207e mld6: fix conditional checksumming
The mld_group structure no longer has a 'netif' field, as such
structures are now linked from the corresponding netif structure.
For conditional checksumming, use the calling function's netif
reference instead.
2016-10-23 10:00:47 +02:00
Axel Lin
20fde0be6c ip4_frag: Use LWIP_MIN instead of open-coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-19 08:37:39 +02:00
Dirk Ziegelmeier
67895e7bdd Fixup new IPv4 fragmentation code - thanks to Zach Smith 2016-10-19 08:36:43 +02:00
Dirk Ziegelmeier
801f26ee0c Minor documentation update 2016-10-16 19:07:55 +02:00
Dirk Ziegelmeier
f5f8ab5acf Fix bug #49328: Crash error in ip6_frag due to Assertion Fail 2016-10-13 08:50:47 +02:00
Dirk Ziegelmeier
e3a9f01fe4 Implement task #14180: IPv6 code should not reuse ip6_current_dest_addr() as temporary storage 2016-10-12 21:41:02 +02:00
goldsimon
6edde498e3 pbuf_copy: try to fix GCC const warning 2016-10-11 09:52:44 +02:00
goldsimon
d5bfec2e52 ip4_frag: restore "lwip_ntohs" after last change 2016-10-11 09:52:20 +02:00
goldsimon
576f49ee2b Fixed bug #46467: ip_frag() shouldn't modify pbuf in case of a retransmission 2016-10-11 09:47:03 +02:00
goldsimon
697be5c2c3 Make some pbuf functions take const pbuf pointers 2016-10-11 09:23:45 +02:00
Axel Lin
c9cfbe27c1 tcp_out: Remove misleading comment in tcp_pbuf_prealloc()
This comment is incorrect since commit 7d0dab9d7d
"partly fixed bug #25882: TCP hangs on MSS > pcb->snd_wnd
(by not creating segments bigger than half the window)".

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-11 09:11:47 +02:00
Dirk Ziegelmeier
ed239c4e71 Apply patch #9139: Invalid format string in dhcp.c
by Thomas Mueller
2016-10-10 09:57:07 +02:00
Dirk Ziegelmeier
695c81762c Minor: Fix comment in etharp.c 2016-10-09 12:28:34 +02:00
Dirk Ziegelmeier
f6e27940bd Make lwIP compile with clang -Wdocumentation -> several documentation fixes 2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
4e74ae4bc9 Minor: documentation updates 2016-10-09 10:23:36 +02:00
Dirk Ziegelmeier
5477aa5a42 Minor: Documentation update 2016-10-09 09:41:26 +02:00
Ari Suutari
70ccea9207 Make sys_restart_timeouts public also for !NO_SYS targets 2016-10-07 20:31:15 +02:00
Dirk Ziegelmeier
13fb616bb2 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>
2016-10-06 12:55:57 +02:00
Dirk Ziegelmeier
0c06073819 Avoid code duplication in def.c 2016-10-06 09:26:59 +02:00
Elias Reichart
60a507f88b ETHARP_TABLE_MATCH_NETIF is also used in the etharp_output shortcut 2016-10-04 22:15:59 +02:00
David van Moolenbroek
0d7805a86a tcp: fix FIN ACK handling with unsent data
TCP's snd_nxt represents the next sequence number after sent data, and
as such does not cover any unsent data queued on the connection.  The
current implementation does not take the latter point into account
when processing FIN acknowledgments, mistakenly assuming that an
outgoing FIN is ACK'ed when the acknowledgment covers up to snd_nxt
while there is still unsent data.  This patch adds a check for unsent
data to correct this, effectively preventing that TCP connections are
closed prematurely.
2016-10-04 22:12:13 +02:00
David van Moolenbroek
9ba9dee2aa tcp: advance next seq nr for zero window probes
It is possible that the byte sent as a zero window probe is accepted
and acknowledged by the receiver side without the window being opened.
In that case, the stream has effectively advanced by one byte, and
since lwIP did not take this into account on the sender side, the
result was a desynchronization between the sender and the receiver.
That situation could occur even on a lwIP loopback device, after
filling up the receiver side's receive buffer, and resulted in an ACK
storm. This patch corrects the problem by advancing the sender's next
sequence number by one as needed when sending a zero window probe.
2016-10-04 22:06:05 +02:00
Dirk Ziegelmeier
bef7873042 ND6: Always set neighbor_cache.state together with counter value to avoid inconsistency 2016-10-04 13:59:05 +02:00
Dirk Ziegelmeier
ee27daffc4 Fix bug #48876: nd6: timers should be in ticks, not ms
delay_time and stale_time are ticks now.
reachable_time and invalidation_timer are untouched since they may originate from telegram values -> not converting them to ticks avoids an integer division
2016-10-04 13:30:23 +02:00
Dirk Ziegelmeier
eb77c839fc Minor: comment in pbuf.c 2016-10-03 09:45:59 +02:00
Axel Lin
5e15125b3d igmp: Fix optimized code by always skipping the first entry in the linked groups list
commit 8c52afb6ca ("igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry")
accidently changes the code logic. it should check groupref rather than group.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-02 19:36:59 +02:00
Dirk Ziegelmeier
8f8f56914b Fix bug #47731: IGMP state transition missing
Set state variable according to RFC 2236 on timeout in delaying member state
2016-10-01 21:27:00 +02:00
Dirk Ziegelmeier
8c52afb6ca igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry 2016-10-01 17:28:36 +02:00
Dirk Ziegelmeier
df5a79966d Fix bug #48886: raw pcbs are not handled on netif address change 2016-10-01 17:13:33 +02:00
Dirk Ziegelmeier
149701b347 Fix bug #49218: pbuf_clen() overflow as a result of tcp_write concatenation
Let pbuf_clen() return u16_t
2016-09-30 09:04:36 +02:00
Dirk Ziegelmeier
65796cd827 "Fix" bug #49078: lwip cannot establish ipv6 connection, because of failed to fill ipv6 source address in Neighbor Solicitation Message by adding a note to netif_add not to forget to create a link-local IPv6 address 2016-09-29 12:02:50 +02:00
Dirk Ziegelmeier
17e6c9dd02 Add #include <string.h> in def.c since lwip_strnstr uses strlen and strcmp 2016-09-29 08:08:26 +02:00
Dirk Ziegelmeier
0e7f48d81c Fix compile of new functions in def.c - I accidentally put them in a #ifdef section
Thanks to Daniel Elstner
2016-09-28 22:26:55 +02:00
Dirk Ziegelmeier
4144d54642 Fix implementation of lwip_itoa to take more parameters 2016-09-28 22:05:18 +02:00
Dirk Ziegelmeier
1f68b32485 Cleanup handling of non-standard functions in lwIP
- itoa
- strnicmp, stricmp/strcasecmp
- strnstr
Related to patch #9115: httpd.c: strcasecmp for GCC and stricmp for Windows
2016-09-28 21:52:11 +02:00
Dirk Ziegelmeier
633696c153 Implement consistent IPx_ADDR_ANYx macro naming between IPv4 and IPv6
- rename IP4_ADDR_ANY to IP4_ADDR_ANY4
- IP4_ADDR_ANY (= IP_ADDR_ANY) is now IPv4 any address in ip_addr_t format
2016-09-28 12:56:57 +02:00
Dirk Ziegelmeier
6abcd00f71 Convert IP address type numbers to an enum to improve documentation 2016-09-27 09:46:51 +02:00
Dirk Ziegelmeier
97b774ceb9 Minor: Documentation updates 2016-09-26 21:45:29 +02:00
Daniel Elstner
2f085aa441 ND6: Join/leave groups directly on the netif 2016-09-26 11:44:00 +02:00
Daniel Elstner
354e385453 Fix infinite loop in new MLD6 code 2016-09-26 11:43:59 +02:00
Dirk Ziegelmeier
c7c6b7ce93 Rework IGMP and MLD6 code to store group info per-netif.
Reasoning:
- Makes code in single-netif case perform better and smaller
- IGMP / MLD6 code is a little bit easier to read and understand
- Easier to get multicast groups per netif when implementing drivers

Downside: In multi-netif mode, there are two more pointers on each netif, even if IGMP/MLD6 is not used on it. But these systems should not be so memory-constrained that this will matter.
2016-09-21 13:33:33 +02:00
Dirk Ziegelmeier
c25de8f317 Update comment in MDNS and pbuf.c 2016-09-21 12:37:31 +02:00
Dirk Ziegelmeier
eb3a08308d Improve my last docs 2016-09-20 09:14:32 +02:00
Dirk Ziegelmeier
470dae613e Documentation: Add example for zero-copy RX using custom PBUF 2016-09-20 09:03:49 +02:00
Daniel Elstner
22907c7b27 bug #74921: check prefix_length, not length 2016-09-19 18:38:05 +02:00
Dirk Ziegelmeier
623f9ce046 Remove one debug message from Daniel's patch 2016-09-19 12:32:43 +02:00