We don't have to keep a helper function just for the sake of a PBUF_RAW
constant. Inline ppp_singlebuf function.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
pbuf_coalesce() creates a single pbuf out of a chain of pbufs, which is
exactly what ppp_singlebuf() need.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Fix below build error if LWIP_IPV4 == 0.
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/netif.c
../../../../lwip/src/core/netif.c: In function ‘netif_add’:
../../../../lwip/src/core/netif.c:284:7: error: ‘ipaddr’ undeclared (first use in this function)
if (ipaddr == NULL) {
^~~~~~
../../../../lwip/src/core/netif.c:284:7: note: each undeclared identifier is reported only once for each function it appears in
../../../../lwip/src/core/netif.c:285:14: error: implicit declaration of function ‘ip_2_ip4’ [-Werror=implicit-function-declaration]
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~~~
../../../../lwip/src/core/netif.c:285:5: error: nested extern declaration of ‘ip_2_ip4’ [-Werror=nested-externs]
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~
../../../../lwip/src/core/netif.c:285:23: error: ‘IP4_ADDR_ANY’ undeclared (first use in this function)
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~~~~~~~
../../../../lwip/src/core/netif.c:287:7: error: ‘netmask’ undeclared (first use in this function)
if (netmask == NULL) {
^~~~~~~
../../../../lwip/src/core/netif.c:290:7: error: ‘gw’ undeclared (first use in this function)
if (gw == NULL) {
^~
cc1: all warnings being treated as errors
../../Common.allports.mk:94: recipe for target 'netif.o' failed
make: *** [netif.o] Error 1
Fixes: 5967380c2034 ("netif_add: avoid passing NULL pointers to subsequent functions")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
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>
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