Commit Graph

6801 Commits

Author SHA1 Message Date
Nate Karstens
ea53e5aa6e Implement IPV6_RECVHOPLIMIT socket option
Implements the IPV6_RECVHOPLIMIT socket option for receiving the hop
limit in the IPv6 packet.

Based on work from https://savannah.nongnu.org/patch/?9554

Co-authored-by: Christina Schoenrogge <christina.schoenrogge@garmin.com>
Co-authored-by: hanhui <hanhui03@163.com>
2023-10-04 10:07:59 -05:00
Nate Karstens
c004029f77 Render IPv6 addresses in lower case
RFC5952 section 4.3 requires text representations
of IPv6 addresses to use lower case.

Co-authored-by: Chee Bin Hoh <hohcheebin@gmail.com>
2023-10-04 10:07:59 -05:00
Nate Karstens
70a730df64 Implement IPV6_RECVPKTINFO socket option
Implements the IPV6_RECVPKTINFO socket option for receiving ancillary
data about an IPv6 packet.

Also fixes an issue where the interface index was not being copied
and updates IP_PKTINFO flag to use netconn flags macros.

Based on work from https://savannah.nongnu.org/patch/?9554

Co-authored-by: Christina Schoenrogge <christina.schoenrogge@garmin.com>
Co-authored-by: Joseph Huang <joseph.huang@garmin.com>
Co-authored-by: Chee Bin Hoh <hohcheebin@gmail.com>
Co-authored-by: hanhui <hanhui03@163.com>
2023-10-04 10:07:59 -05:00
Nate Karstens
4dd7e9f816 Use macros in setsockopt handling of IP_PKTINFO
Changes setsockopt handling of IP_PKTINFO to use the provided macros.
2023-10-04 10:07:59 -05:00
Nate Karstens
147809861a Implement IPV6_MULTICAST_LOOP socket option
Implements the IPV6_MULTICAST_LOOP socket option, which controls
if a copy of the packet is looped back for local delivery.
2023-10-04 10:07:59 -05:00
Nate Karstens
64cd2582ca Improve getsockopt for IP_MULTICAST_LOOP
Changes getsockopt handling for IP_MULTICAST_LOOP to
test for UDP and use macro. Also fixes debug message.
2023-10-04 10:07:59 -05:00
Nate Karstens
545a57ce60 Implement IPV6_MULTICAST_HOPS socket option
Implements the IPV6_MULTICAST_HOPS socket option, which sets
the hop limit for outgoing multicast packets.

Also fixes debug message in getsockopt for IP_MULTICAST_TTL.

Based on work from https://savannah.nongnu.org/patch/?9554

Co-authored-by: Christina Schoenrogge <christina.schoenrogge@garmin.com>
Co-authored-by: Chee Bin Hoh <hohcheebin@gmail.com>
Co-authored-by: hanhui <hanhui03@163.com>
2023-10-04 10:07:59 -05:00
Nate Karstens
e27013aec3 Use macro to test netconn_type
Changes two IPv4 multicast socket options to use the
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE macro.
2023-10-04 10:07:59 -05:00
Nate Karstens
d96a90a5ec Implement IPV6_MULTICAST_IF socket option
Implements the IPV6_MULTICAST_IF socket option, which
specifies the interface for outgoing multicast packets.

Based on work from https://savannah.nongnu.org/patch/?9554

Co-authored-by: Christina Schoenrogge <christina.schoenrogge@garmin.com>
Co-authored-by: Chee Bin Hoh <hohcheebin@gmail.com>
Co-authored-by: hanhui <hanhui03@163.com>
2023-10-04 10:07:59 -05:00
Nate Karstens
64b758d00c Implement IPV6_UNICAST_HOPS socket option
Implements the IPV6_UNICAST_HOPS socket option, which sets
the hop limit for outgoing unicast IPv6 packets.

Based on work from https://savannah.nongnu.org/patch/?9554

Co-authored-by: Christina Schoenrogge <christina.schoenrogge@garmin.com>
Co-authored-by: Chee Bin Hoh <hohcheebin@gmail.com>
Co-authored-by: hanhui <hanhui03@163.com>
2023-10-04 10:07:59 -05:00
Simon Goldschmidt
732d3411bf fuzz: count packets for debugging 2023-10-03 21:37:14 +02:00
Simon Goldschmidt
9509acd876 fuzz: fix warning casting u64_t to s32_t/u32_t 2023-10-03 21:11:57 +02:00
Simon Goldschmidt
5fea01a0a8 msvc: add project + sln for fuzz tests 2023-10-03 21:11:26 +02:00
Simon Goldschmidt
f85ed72bac ipv6: frag: fix bogus icmp6 response on reassembly timeout
See bug #63929
2023-10-03 17:50:28 +02:00
Simon Goldschmidt
1ef6189287 pbuf: fix "returns" documentation on pbuf_get_contiguous()
See bug #64049
2023-10-03 17:34:53 +02:00
Simon Goldschmidt
ae5a5b99eb tcp: fix compiling with LWIP_NOASSERT
See bug #64734
2023-10-03 17:31:19 +02:00
Maxim Uvarov
de6b0a35f8 ping: do not clear IP address with ping_stop at the init
commit 4e6dd9 "ping: add stop function", was corrected
and wrongly added stop function after IP address set up.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2023-10-03 17:15:56 +02:00
Yonggang Luo
dad8c4c72a guard when data is NULL
[build] ../../3rd/lwip/src/include/lwip/opt.h:137:41: error: argument 2 null where non-null expected [-Werror=nonnull]
[build]  #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
[build]                                          ^~~~~~~~~~~~~~~~~~~
[build] ../../3rd/lwip/src/netif/ppp/fsm.c:791:7: note: in expansion of macro 'MEMCPY'
[build]        MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen);
[build]        ^~~~~~
[build] In file included from c:\mentorgraphics\fly380s_8910\prebuilts\win32\gcc-arm-none-eabi\arm-none-eabi\include\sys\time.h:40:0,
[build]                  from ../../3rd/../src/cat1/arch/cc.h:40,
[build]                  from ../../3rd/lwip/src/include/lwip/arch.h:50,
[build]                  from ../../3rd/lwip/src/include/lwip/debug.h:40,
[build]                  from ../../3rd/lwip/src/include/lwip/opt.h:52,
[build]                  from ../../3rd/lwip/src/include/netif/ppp/ppp_opts.h:31,
[build]                  from ../../3rd/lwip/src/netif/ppp/fsm.c:43:
[build] c:\mentorgraphics\fly380s_8910\prebuilts\win32\gcc-arm-none-eabi\arm-none-eabi\include\string.h:31:8: note: in a call to function 'memcpy' declared here
[build]  _PTR   _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t));
[build]         ^
2023-09-29 22:21:02 +02:00
Simon Goldschmidt
14444c1c7f mqtt: support binary Will Message
see patch #10049
2023-09-29 22:08:03 +02:00
Simon Goldschmidt
2d6883c432 minor: fix spaces in unix/lib/lwipopts.h 2023-09-29 21:42:02 +02:00
Florian La Roche
0d5db9469e opt.h: Fix typo 2023-09-28 23:15:53 +02:00
Erik Ekman
339372919a mem: Include stdio.h
Memory overflow checks uses snprintf. Reported in bug #63904.
2023-09-28 23:04:37 +02:00
Erik Ekman
6f700a157d nd6: Fix RA link-local address option length check
Length field is in units of 8 bytes.
2023-09-28 22:39:14 +02:00
Simon Goldschmidt
2159f84682 httpd: compare client requests case-insensitive
Fixes bug #10047 (Fix case-sensitive comparison of Content-Length header for POST requests)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-09-28 22:30:47 +02:00
Erik Ekman
7807f706f3 nd6: Update RA link-local addr option length check
lwIP might support different hardware address lengths (when using
Ethernet and 6LoWPAN for instance). Match provided lladdr length
from Router Advertisement to the current network interface instead
of comparing against longest that can be stored.
2023-09-28 22:23:25 +02:00
Erik Ekman
4f78da983f ci: Bump github action version
Fix warning:
"The following actions uses node12 which is deprecated and will be forced
to run on node16: actions/checkout@v2."
2023-09-28 21:06:09 +02:00
Simon Goldschmidt
d8b97bfc5d icmp: fix bug #64211 (ICMP reply error when using bridge)
when reusing an rx pbuf for tx, its if_idx has to be reset or else bridgeif_send_to_port() might drop it
2023-09-27 21:49:24 +02:00
Simon Goldschmidt
f7fe057821 win32 pcapif: fix "heap-use-after-free" on shutdown 2023-09-27 21:28:29 +02:00
Simon Goldschmidt
3792075baf Fix bug #64637 ("iperf -n 1000 -r" does not work) 2023-09-27 21:01:52 +02:00
Maxim Uvarov
4e6dd9c576 ping: add stop function
ping in raw mode does some set up and sets timeout, but clean
up procedure is missing. That is needed for case if PING_RESULT() macro
is used for application exit.

Also implement stop functionality when using sockets.
Running ping is stopped when calling ping_init() again.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-09-27 20:56:46 +02:00
Simon Goldschmidt
36cb95c4d2 next release will probably be 2.2.1... 2023-09-27 20:38:41 +02:00
Simon Goldschmidt
0a0452b2c3 Prepare 2.2.0 release 2023-09-25 21:25:35 +02:00
Simon Goldschmidt
c0cf130bb7 Prepare changelog for 2.2.0 release 2023-09-22 10:02:18 +02:00
Simon Goldschmidt
3eeda139bc minor coding style/spelling fixes 2023-09-22 09:54:36 +02:00
Simon Goldschmidt
b92faffaaa LWIP_VLAN_PCP==1: initialize tci correctly (disabled); add pcb_tci_*() functions to access the tci 2023-09-22 09:53:13 +02:00
Simon Goldschmidt
84fde1ebbf release: mark 2.2.0 RC1
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:22:19 +02:00
Simon Goldschmidt
2a3711a566 win32: check: adjust check config.h to run with newest check library on VS2022
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:14:36 +02:00
Simon Goldschmidt
1a5dffb931 win32: pcapif: ensure we can run with npcap as well
By default, npcap keeps its DLLs not in system32 but in system32/npcap.
To load DLLs from there, mark them as "delay load DLLs" and adjust the
DLL search path before using/loading them.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:11:55 +02:00
Simon Goldschmidt
bfcbf80221 win32: msvc: fix msvc project files to compile with VS2022; add test_tcp_state
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 22:08:45 +02:00
Simon Goldschmidt
657c9735a7 doxygen: dhcp: fix doxygen stumbling over nonexisting define 2023-06-29 21:59:05 +02:00
Simon Goldschmidt
9672405eb9 test: unit: tcp: fix tcp state tests to not break other tests
On platform where check cannot fork (win32), the tcp_state tests crashed other tests.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2023-06-29 21:32:20 +02:00
Shawn Silverman
e29870c15e Fix a printf conversion specifier in mdns.c
Use U32_F to print a u32_t.
2023-05-11 22:16:49 +02:00
Shawn Silverman
f84076b112 Add missing terminating newlines to LWIP_DEBUGF statements 2023-05-11 22:13:51 +02:00
Jonathan Neuschäfer
c2f9244137 test/fuzz: Fix use of htons vs. ntohs
Although ntohs and htons perform equivalent operations (a byte swap on
little-endian platforms), their semantic roles (as implied by the names)
are different.

In fuzz_common.c, we get integers from simulated network packages, and
convert them for host CPU use, so ntohs is the right variant to use.
2023-05-11 22:10:32 +02:00
Jonathan Neuschäfer
5514d8eb63 test/fuzz: Build with -O2 by default
Fuzzers should run fast by default, since the goal is to try many
variations of input data.
2023-05-11 22:08:46 +02:00
Jonathan Neuschäfer
911da26f96 test/fuzz: Fix CC default value in makefile
Unfortunately, CC ?= afl-gcc doesn't work. This is because CC has a
default value (of "cc"), and the ?= operator only assigns a value if the
variable previously had none. "make" currently compiles with cc.

In this patch, I implemented the more elaborate way to achieve what was
probably intended: "make" will use afl-gcc now, and "make CC=foo" will
compile with "foo".
2023-05-11 22:08:40 +02:00
Mingjie Shen
2e3dcf06d1 api,sockets: Fix signed overflow check
Signed overflow is undefined behaviour in C/C++.
2023-05-11 21:28:22 +02:00
Mingjie Shen
e3a20b3bc2 mdns: Add null check for pbuf_skip 2023-05-11 21:26:22 +02:00
Jan Breuer
1c5cc7bc02 snmp_v3: fix reported usmUserAuthProtocol for SHA 2023-05-11 21:05:16 +02:00
David Cermak
3aa82745c1 dhcp: Add macro for appending extra client's request options
Co-Authored-By: Liu Han <liuhan@espressif.com>
Co-Authored-By: Simon Goldschmidt <goldsimon@gmx.de>
2023-05-11 21:03:11 +02:00