goldsimon
5c0aab7bd5
udp SO_REUSE_RXTOALL: don't copy IP header in duplicated pbuf
2017-05-03 09:54:46 +02:00
Dirk Ziegelmeier
2b9a132772
Fix compile in tcp_route when IPv4 only is used and source-based routing is disabled
2017-05-03 09:09:37 +02:00
Dirk Ziegelmeier
d32492e953
Make patch 4 of David's Minix3 patches superfluous: Use PBUF_POOL to duplicate incoming packets in UDP
...
... which would have been the correct way to do it anyway :-)
http://git.minix3.org/index.cgi?p=minix.git;a=blob;f=minix/lib/liblwip/patches/0004-MINIX-3-only-avoid-large-contiguous-allocations.patch;h=f23143c7e8d372b3b35b599a97975d79924f73c1;hb=HEAD
2017-05-03 09:02:56 +02:00
goldsimon
7defe372b9
fixed compiling pbuf.c with LWIP_TCP==0
2017-05-03 09:02:06 +02:00
Dirk Ziegelmeier
676dd74140
Minor cleanup and documentation updates
2017-05-03 08:51:00 +02:00
Dirk Ziegelmeier
e835707814
Cleanup and simplify tcp_connect() code
2017-05-03 08:46:06 +02:00
Dirk Ziegelmeier
5800cf51be
Work on task #14494 : Implement SO_BINDTODEVICE
...
TCP needs additional netif handling
2017-05-03 08:00:06 +02:00
Axel Lin
c144e5b1ec
pbuf_coalesce: Replace pbuf_alloc+pbuf_copy with pbuf_clone
...
Avoid duplicate the same implementation.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-05-02 20:36:00 +02:00
Axel Lin
bc0fafdeca
udp: Fix compiling for IPv6-only build
...
Fix below build error when LWIP_IPV6 && !LWIP_IPV4:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/core/udp.c
../../../../lwip/src/core/udp.c: In function ‘udp_input_local_match’:
../../../../lwip/src/core/udp.c:130:58: error: unused parameter ‘inp’ [-Werror=unused-parameter]
udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
^~~
Fixes: 13ffc86aeff3 ("Start working task #14494 : Implement SO_BINDTODEVICE")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-02 15:55:32 +02:00
Dirk Ziegelmeier
eab2ae5d78
Cleanup netif_name_to_index() implementation
2017-05-02 12:51:25 +02:00
goldsimon
0545eba002
Fixed copy&paste error found by travis-ci...
2017-05-02 10:42:59 +02:00
Dirk Ziegelmeier
13ffc86aef
Start working task #14494 : Implement SO_BINDTODEVICE
...
Implement binding TCP, UDP and RAW PCBs to a netif
2017-05-02 09:39:48 +02:00
Dirk Ziegelmeier
20fed63297
Add custom pbuf usage example to pbuf_alloced_custom() docs
2017-04-28 13:19:32 +02:00
Dirk Ziegelmeier
1aa24ee21b
Add new DHCP hooks to DHCP docs
2017-04-27 12:42:14 +02:00
Dirk Ziegelmeier
a09a8e4a06
Some documentation updates and fixes
...
Dedicated Zero-copy RX page
Fix doxygen warnings
2017-04-27 12:41:08 +02:00
goldsimon
6aac9377ee
Clean up LWIP_NETIF_HWADDRHINT a bit: create a struct holding the hint(s) and pass a pointer to that struct around. That way we are free to add more hints if required (e.g. see task #11620 )
2017-04-27 12:39:54 +02:00
Axel Lin
4c9b316e6b
pbuf: Fix allocate zero length pbuf
...
Current code fails to allocate zero length pbuf (e.g. for PBUF_RAW PBUF_POOL),
fix it.
Fixes: eb269e61b5d3 ("First step to clean up pbuf implementation: add pbuf_alloc_reference() to allocate pbufs referencing external payload; move member initialization to common function; simplify PBUF_POOL chain allocator")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-04-26 20:15:22 +02:00
goldsimon
eb269e61b5
First step to clean up pbuf implementation: add pbuf_alloc_reference() to allocate pbufs referencing external payload; move member initialization to common function; simplify PBUF_POOL chain allocator
2017-04-25 23:04:12 +02:00
goldsimon
e57552d401
pbuf_alloc_copy -> pbuf_clone
2017-04-25 22:02:07 +02:00
goldsimon
2fef874494
task #14270 : DHCP should support user-defined additional options: added two hooks for adding and parsing user defined DHCP options
2017-04-25 20:18:59 +02:00
Axel Lin
471daba011
tcp_out: Fix LWIP_NETIF_TX_SINGLE_PBUF guard for not executing phase 2
...
This fixes build error if LWIP_NETIF_TX_SINGLE_PBUF==1.
Fixes: dd811bca0689 ("Fix bug #50694 (TX exist more pbufs after enable LWIP_NETIF_TX_SINGLE_PBUF) by not executing phase 2 for LWIP_NETIF_TX_SINGLE_PBUF==1")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-04-25 20:17:47 +02:00
goldsimon
ca961b9bc2
minor whitespace cleanups only
2017-04-25 12:07:28 +02:00
goldsimon
d02bc6481f
Fixed bug #50816 (netif_add() prototype depends on configuration) by adding a new function netif_add_noaddrthat doesn't change
2017-04-25 12:05:05 +02:00
goldsimon
135d506065
minor whitespace fixes only
2017-04-25 12:03:52 +02:00
goldsimon
dd811bca06
Fix bug #50694 (TX exist more pbufs after enable LWIP_NETIF_TX_SINGLE_PBUF) by not executing phase 2 for LWIP_NETIF_TX_SINGLE_PBUF==1
2017-04-25 11:18:36 +02:00
goldsimon
dcb2cb99a1
Added 'pbuf_alloc_copy' e.g. as a single function for use with non scatter-gather drivers
2017-04-25 10:08:31 +02:00
goldsimon
9c6da979ca
fixed copy&paste error in last change to lwip_itoa()
2017-04-24 13:33:43 +02:00
goldsimon
16a71473c1
Better fix for bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS): only lock where necessary
2017-04-24 12:23:05 +02:00
Joel Cunningham
ad779e5c9c
doc: clarify RST handling comment
...
This clarifies the documentation around RST handling to document
the approach follows RFC 5961 and is not a standards violation
2017-04-21 09:27:54 -05:00
Joel Cunningham
de90d03e48
tcp: task #14128 - Appropriate Byte Counting support
...
This commit adds TCP Appropriate Byte Counting (ABC) support based on
RFC 3465
ABC replaces the previous congestion window growth mechanism and has been
configured with limit of 2 SMSS. See task #14128 for discussion on
defaults, but the goal is to mitigate the performance impact of delayed
ACKs on congestion window growth
This commit also introduces a mechanism to track when the stack is
undergoing a period following an RTO where data is being retransmitted.
Lastly, this adds a unit test to verify RTO period tracking and some
basic ABC cwnd checking
2017-04-20 15:59:24 -05:00
goldsimon
131d656c23
lwip_itoa: check 'bufsize' instead of ignoring it; ensure code is not stolen from GPL
2017-04-20 21:57:03 +02:00
Dirk Ziegelmeier
32aa9a41e2
Apply patch from Kudratov Olimjon: Array index used before limits check
...
while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
should be
while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {
See https://jira.reactos.org/browse/CORE-8978 for more info.
2017-04-19 06:35:07 +02:00
Joel Cunningham
f28c1c851b
loopif: set pbuf if_idx during poll
...
This sets the pbuf's if_idx during the loopif poll function (the
equivalent netif input function). This was found during IP_PKTINFO
development where p->if_idx is read and was uninitialized
2017-04-15 11:31:38 -05:00
Joel Cunningham
557a11047d
Patch #9307 : Replace mem_malloc+memset with mem_calloc
...
Aside from reducing source code, on systems which use MEM_LIBC_MALLOC,
this has the potential to improve performance depending on the underlying
memory allocator
See http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc
2017-04-05 14:53:24 -05:00
goldsimon
b34f2d5605
altcp: allocate altcp_pcbs from a pool, not from heap (new option MEMP_NUM_ALTCP_PCB defaults to MEMP_NUM_TCP_PCB)
2017-04-05 12:18:48 +02:00
goldsimon
2a30fedbea
fix passing NULL to netif_set_gw & netif_set_netmask (or netif_set_addr or netif_add) (broken on 18.03.2017 by 2d9ef2215b5f276d8c7d34839bc6becfb063faab)
2017-04-04 22:08:37 +02:00
goldsimon
e65a0950b2
mem_calloc: check for mem_size_t overflow when multiplying 2 mem_size_t input values
2017-04-04 21:52:01 +02:00
goldsimon
33466ee6a8
dhcp_parse_reply: return ERR_VAL instead of asserting on offset-out-of-pbuf
2017-03-30 22:30:27 +02:00
goldsimon
3aa854409a
pbuf_copy_partial: remove double-check of 'buf' and 'dataptr'
2017-03-30 21:29:53 +02:00
goldsimon
51dbd1a7c0
altcp: added altcp_get_port()
2017-03-30 14:19:31 +02:00
Joel Cunningham
c722261142
tcp: bug #50614 : move unsent queue check/pcb->snd_buf update
...
This commit corrects what looks like an ancient incorrect organization
of the logic for processing an ACK which acks new data. Once moved,
we can also change to using TCP_SEQ_LEQ on ackno instead of TCP_BETWEEN
because ackno has already been checked against snd_nxt
The work of checking the unsent queue and updating pcb->snd_buf (both
steps required for new data ACK) should be located under the conditional
that checks TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)
The comment following the unsent queue check/pcb->snd_buf update even
indicates "End of ACK for new data processing" when the logic is clearly
outside of this check
From what I can tell, this mis-organization isn't causing any incorrect
behavior since the unsent queue checked that ackno was between start of
segment and snd_nxt and recv_acked would be 0 during pcb->snd_buf update.
Instead this is waisted work for duplicate ACKS (can be common) and other
old ACKs
2017-03-29 16:24:54 -05:00
Dirk Ziegelmeier
fbcdb4d9f1
Fix function name in altcp.c
2017-03-29 08:22:35 +02:00
goldsimon
b09b3fa4e6
altcp_tcp: some more debug checks
2017-03-28 16:20:20 +02:00
goldsimon
537c258efa
httpd/altcp: add forgotten functions
2017-03-28 14:04:40 +02:00
goldsimon
1dfe916808
altcp_tcp: use 'void* state' to store tcp_pcb, not 'altcp_pcb* inner_conn'
2017-03-28 09:09:13 +02:00
goldsimon
425b2dda61
altcp_get_ip: added altcp_get_ip(), added default functions that only defer a call to the inner_conn (moved from tls_mbedtls to generic altcp)
2017-03-26 22:26:40 +02:00
goldsimon
540b527cf4
remove LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS config option (this is implicitly done via #ifdef LWIP_RAND)
2017-03-24 14:29:06 +01:00
Dirk Ziegelmeier
ab736a4764
Add altcp to doxygen docs
2017-03-22 23:32:32 +01:00
Dirk Ziegelmeier
7e12240af3
Improve TCP documentation a bit
2017-03-22 23:32:17 +01:00
Dirk Ziegelmeier
060a47f88a
Add altcp to Filelists.mk
...
Some compile fixes in altcp_tcp.c and httpd.c
2017-03-22 22:57:50 +01:00