Commit Graph

5373 Commits

Author SHA1 Message Date
goldsimon
eff97c04ef backport of "unreachable code" warnings from STM (why don't people report such things?) 2017-05-03 20:30:38 +02:00
Dirk Ziegelmeier
6c236b047e ip_route() can be called with IP_ANY_TYPE in src parameter, so remove code associated to that 2017-05-03 16:42:30 +02:00
Daniel Elstner
ccf10a5023 SNTP: Avoid warning if debugging is disabled 2017-05-03 16:40:11 +02:00
Joel Cunningham
ddf4e17411 tcp: indentation fix in tcp_receive()
TCP_OVERSIZE block was moved out from inside the while loop and thus
should be on column 7
2017-05-03 09:29:02 -05:00
goldsimon
4cf6f9ed51 tcp_free_acked_segments: fix debug printf parameter errors, fix unused parameters for !LWIP_DEBUG and/or LWIP_NOASSERT 2017-05-03 13:49:24 +02:00
goldsimon
778206798e task #14433: TCP: combine unsent/unacked queue loops in tcp_receive() 2017-05-03 12:32:01 +02:00
goldsimon
39316bb9de httpd: fixed bug #50915 (HTTP_IS_DATA_VOLATILE was wrong for LWIP_HTTPD_DYNAMIC_FILE_READ==1) 2017-05-03 09:57:12 +02:00
goldsimon
b9c47c5089 tcp_route: add comment, fixed whitespace 2017-05-03 09:56:08 +02:00
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
goldsimon
082fe71c0c fixed compiling sockets.c with LWIP_UDP==0 2017-05-03 09:01:48 +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: 13ffc86aef ("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
e3289116b9 Fix next build error introduced in my last commit 2017-05-02 15:21:52 +02:00
Dirk Ziegelmeier
6a754325dc Fix build error introduced in my last commit 2017-05-02 14:53:18 +02:00
Dirk Ziegelmeier
c7e3519f46 Start working task #14494: Implement SO_BINDTODEVICE
Implement setsockopt. TODO: getsockopt
2017-05-02 13:18:29 +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
83d0607acf Add PBUF_NEEDS_COPY macro to documentation 2017-04-27 19:25:19 +02:00
goldsimon
1add8c14ca netif: tiny cleanup to last commit 2017-04-27 14:12:13 +02:00
goldsimon
975e29d76e fixed copy&paste error :-) 2017-04-27 12:46:14 +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
goldsimon
7617a76b19 added unit test to allocate zero length pbufs 2017-04-26 20:16:27 +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: 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")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-04-26 20:15:22 +02:00
Joel Cunningham
fc7a68b5af sockets: fix CMSG alignment
This changes the CMSG alignment macros to ensure struct cmsghdr and data
are on a word (double word on 16-bit arch) aligned boundary

We need to ensure at least 32-bit alignment for 16-bit systems because
socklen_t could be 32-bit due to our definition
2017-04-26 08:39:44 -05:00
Dirk Ziegelmeier
c686261e1e Minor whitespace cleanup in ip.h 2017-04-26 12:28:54 +02:00
goldsimon
728aaeb528 Try to fix alignment warnings in CMSG_NXTHDR() 2017-04-26 08:55:07 +02:00
goldsimon
eac45ca284 Try to fix alignment warnings when assigning CMSG_DATA() to some struct pointer 2017-04-26 08:43:56 +02:00
Joel Cunningham
0b6e2d9c15 Update changelog for features/bugs since 2.0.1 2017-04-25 17:40:11 -05:00
goldsimon
842a235a68 fix test_sockets_msgapi_cmsg unit test (msvc gives me "warning C4706: assignment within conditional expression") 2017-04-25 23:08:53 +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
Joel Cunningham
3a01c32e55 test_sockets: fix pointer to integer conversion
This fixes a pointer to integer conversion in test_sockets_msgapi_cmsg()

This was identified by Travis CI: https://travis-ci.org/yarrick/lwip-merged/builds/225640702
2017-04-25 13:48:14 -05:00
goldsimon
836c0cf42e added dhcp hooks to CHANGELOG 2017-04-25 20:20:13 +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: 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")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-04-25 20:17:47 +02:00
Joel Cunningham
2f117add7a sockets: task #14247, add CMSG and IP_PKTINFO
This commit adds CMSG infrastructure (currently used with recvmsg) and
the IP_PKTINFO socket option.

In order to use IP_PKTINFO, set LWIP_NETBUF_RECVINFO to 1

Unit test is added to verify this feature
2017-04-25 09:44:03 -05: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