Erik Ekman
264a5a3e97
Rename IP and Ethernet equality checkers from _cmp to _eq
...
Functions ending in cmp are expected to return 0 on equality but these
return non-zero.
eth_addr_cmp -> eth_addr_eq
ip_addr_cmp -> ip_addr_eq
ip4_addr_cmp -> ip4_addr_eq
ip6_addr_cmp -> ip6_addr_eq
ip_addr_netcmp -> ip_addr_net_eq
ip4_addr_netcmp -> ip4_addr_net_eq
ip6_addr_netcmp -> ip6_addr_net_eq
ip_addr_cmp_zoneless -> ip_addr_zoneless_eq
ip6_addr_cmp_zoneless -> ip6_addr_zoneless_eq
ip6_addr_cmp_zone -> ip6_addr_zone_eq
ip6_addr_netcmp_zoneless -> ip6_addr_net_zoneless_eq
ip6_addr_nethostcmp -> ip6_addr_nethost_eq
ip6_addr_cmp_packed -> ip6_addr_packed_eq
ip6_addr_cmp_solicitednode -> ip6_addr_solicitednode_eq
All call sites have been changed, and fallback macros have been added to not
break external users.
2020-07-07 18:51:45 +02:00
Erik Ekman
2bf8fcd7c2
pbuf: Add pbuf_copy_partial_pbuf library function
...
Like pbuf_copy, but can copy part of a pbuf to an offset in another.
pbuf_copy now uses this function internally.
Replace pbuf_take_at loop in icmp6 with pbuf_copy_partial_pbuf().
2020-07-03 18:55:02 +02:00
Erik Ekman
776e612872
Remove extra newlines in LWIP_ASSERT messages
2020-07-01 20:52:12 +02:00
Erik Ekman
8fe567b86f
ip6: Fix incorrect assert in ip6_frag()
...
New test case now passes.
Fixes bug #57374 (Found by Hiromasa Ito).
2020-06-30 01:27:37 +02:00
Erik Ekman
a49c347b7e
pbuf: Update documentation for pbuf_copy
...
Remove detail from when the method was called pbuf_take
which worked on packet queues.
2020-06-25 10:04:43 +02:00
Erik Ekman
488d4ad246
icmp6: Don't copy too much data
...
Fix of the fix for bug #58553
2020-06-24 01:09:37 +02:00
Erik Ekman
489405839a
icmp6: Fix copying of chained pbuf in reply
...
Fixes bug #58553 , and the newly added unit test.
The pbuf_take_at loop should probably be made into a pbuf library
function, which would avoid this mistake in the future and provide
a simpler implementation of pbuf_copy.
2020-06-24 01:00:12 +02:00
Erik Ekman
e80d4ff2cc
tcp: Fix double free in tcp_split_unsent_seg()
...
Fixes bug #57377 (found by Hiromasa Ito).
2020-06-19 15:39:15 +02:00
Sylvain Rochet
cfe5ce9d49
init: raise an error if PPP CCP_SUPPORT==1 but MPPE_SUPPORT==0
...
Building PPP CCP support without adding any compressor support serve
no real use case. Forbid doing so instead of bloating the code with
more ifdef.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2020-04-09 03:17:30 +02:00
Hannes Gredler
f36e51e9c9
tcp_out: fix tcp_output_fill_options() arguments
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-04-02 20:15:58 +02:00
Karol Domagalski
2e175a23cb
ip4: ip4addr_aton: fix parsing of the octal IP representation
2020-03-05 21:27:59 +01:00
Simon Goldschmidt
adbc5b5f71
tcp: tighten up checks for received SYN
...
Any malicous segment could contain a SYN up to now (no check).
A SYN in the wrong segment could break OOSEQ queueing.
Fix this by allowing SYN only in states where it is required.
See bug #56397 : Assert "tcp_receive: ooseq tcplen > rcv_wnd"
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-03-05 21:20:35 +01:00
Simon Goldschmidt
349c077feb
Fix last commit for all netif loopback traffic
2020-02-21 17:25:51 +01:00
Nick Ballhorn-Wagner
349ec76ee5
fix memory leak in netif_loop_output if tcpip_try_callback fails
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-21 17:17:08 +01:00
Simon Goldschmidt
1ffcc5079c
Fix-more-typos-using-codespell
...
Committing nearly all changes done by 'codespell_check.sh -w'
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:53 +01:00
jona
d6a6b661d9
Fix typos using codespell
...
Conservative strategy was used, maybe other typos remain.
Rebased: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-15 21:45:41 +01:00
Simon Goldschmidt
d843e47a1d
icmp6: keep to the RFC and send as much as possible with icmp6 error messages
...
See bug 56013
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-05 20:43:25 +01:00
Gao Qingshui
a9ac18aebb
ip6: enable ip6_autoconfig_enabled by default
...
See bug #56135
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-04 22:23:58 +01:00
Simon Goldschmidt
064d816ea1
altcp: fix altcp_tcp_close for LISTEN pcb
...
See bug #55219
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-03 22:13:07 +01:00
Simon Goldschmidt
84228d4f4b
nd6: cache neighbour index for each next hop, not globally
...
See bug #47792
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-03 21:53:22 +01:00
Simon Goldschmidt
dc41eabf5f
nd6: check defines for global tables for validity
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-03 21:49:57 +01:00
Simon Goldschmidt
b3046d938e
nd6: use a pointer where appropriate to make the code more readable
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-02-03 21:33:21 +01:00
Simon Goldschmidt
177bb6ca06
nd6: update addr_hint only if the index has actually changed
2020-02-03 20:57:28 +01:00
Simon Goldschmidt
5de4967f23
ip4: forward: try to fix the build...
...
... by adding a default case
2020-01-30 23:22:00 +01:00
Simon Goldschmidt
38894637e7
ip4: forward: remove invalid const modifiers
...
This should fix the build...
2020-01-30 23:13:07 +01:00
Simon Goldschmidt
61c67fc229
ip_forward: fix IPv4 forwarding with multiple netifs/offloading
...
When we have multiple netifs where at least one has checksum offloading
capabilities, IP forwarding needs to set various checksum fields to 0
to prevent HW algorithms on calculating an invalid checksum.
-> set checksum fields of IP/UDP/TCP/ICMP to 0 in ip4_forward().
See bug #56288
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-01-30 23:02:16 +01:00
Simon Goldschmidt
695c323164
icmp: add a dedicated struct for the standard ICMP header
...
This is just to keep the code clean and prevent using the "echo" header
where any ICMP header is meant.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2020-01-30 22:50:25 +01:00
Simon Goldschmidt
8a8058a436
netif: add IPV4_ADDR_VALID ext status callback reason
...
This ext-callback reason is always issued when an IPv4 config
has been set, even if it has not changed (e.g. DHCP reboot)
See bug #55121
2020-01-12 20:30:38 +01:00
Simon Goldschmidt
bb31fbd737
ip6: fix printing rx packet headers
...
The call to ip6_debug_print needs to be moved before the
next-header parsing code.
See bug #56708
2020-01-10 23:10:49 +01:00
Axel Lin
555812dcec
netif_find: correctly check if atoi means '0' or error
...
Fixes: 4528215c99ba ("netif_find: check if atoi means '0' or error")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2019-12-12 09:23:11 +08:00
Simon Goldschmidt
a9e73bc412
ip6addr_aton: support scoped address strings (via '%')
...
See task #15393
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-11 20:43:28 +01:00
Simon Goldschmidt
4528215c99
netif_find: check if atoi means '0' or error
...
Since atoi() returns 0 on error, we need to check if name[2] is '0'.
If it's not, atoi() failed.
2019-12-11 20:42:36 +01:00
Simon Goldschmidt
0caacf82b4
netif_add: zero-init netif->acd_list
2019-12-11 19:49:50 +01:00
Simon Goldschmidt
af0499131f
autoip: fix typo
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-10 21:43:47 +01:00
David Girault
30d445bd39
acd: inform address is good only when going in ongoing state
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-10 21:37:03 +01:00
David Girault
05ffe144dd
acd: reset conflict count to ensure fast re-probing after announcing
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-10 21:37:03 +01:00
David Girault
e09add37c1
acd: fix MAX_CONFLICTS check accorting RFC.
...
As written in RFC5227 in 2.1.1 Probe Details:
A host implementing this specification MUST take precautions to limit
the rate at which it probes for new candidate addresses: if the host
experiences MAX_CONFLICTS or more address conflicts on a given
interface, then the host MUST limit the rate at which it probes for
new addresses on this interface to no more than one attempted new
address per RATE_LIMIT_INTERVAL.
But `acd_restart` restart function check for `acd->num_conflicts > MAX_CONFLICTS`
which allow one more probe than expected.
So this commit change the test to `acd->num_conflicts >= MAX_CONFLICTS`.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-12-10 21:37:03 +01:00
Simon Goldschmidt
03998f5147
autoip: fix 'autoip_remove_struct()' after changing storage to 'netif_client_data'
...
Reported-by: Amena El Homsi <amena.elhomsi@gmail.com>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-11-21 22:19:35 +01:00
Dirk Ziegelmeier
79cd89f99d
Fix possible NULL pointer dereference in autoip_start()
...
autoip variable is dereferenced (autoip->state) before it is checked for NULL pointer
2019-08-28 07:24:31 +02:00
Simon Goldschmidt
c53a8444e8
dhcp: don't use LWIP_ERROR in dhcp_parse_reply()
...
See bug #56643
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-07-26 20:43:08 +02:00
Simon Goldschmidt
aa545fbbc6
LWIP_NETCONN_FULLDUPLEX is not alpha any more
2019-07-10 21:14:35 +02:00
Dirk Ziegelmeier
0255106d55
Fix bug #56136 : The netif->mtu6 was updated by Router Advertisement abnomally
...
Using patch from Gao Quingahui plus improvement
2019-05-06 12:37:19 +02:00
Our Air Quality
c156cd2a33
ND6: add an explicit queue size check.
...
When using the MEMP_MEM_MALLOC option, memp_malloc() can not be relied on to
limit the number of allocations allowed for each MEMP queue, as the ND6 code
had been. This caused the ND6 queue to keep growing until the heap allocation
failed when using the MEMP_MEM_MALLOC option. So add an explicit queue size
check in ND6.
2019-04-30 12:34:43 +02:00
Freddie Chopin
ec11b289cb
Fix and simplify newlines in doxygen documentation
...
Replace '\n' with '<br>', as this allows doxygen to understand reference
names followed by newline. For some cases just drop the newline if it's
not required.
Doxygen 1.8.15 doesn't like if the name of reference is followed by
anything else than (selected?) punctuation or whitespace.
bug #56004
2019-03-28 08:18:20 +01:00
Freddie Chopin
c594599350
Fix doxygen @ref in altcp.c
...
Doxygen 1.8.15 doesn't like if the name of reference is followed by
anything else than (selected?) punctuation or whitespace.
bug #56004
2019-03-28 08:18:19 +01:00
Dirk Ziegelmeier
53818ad3e4
Add #define for minimum IPv6 MTU length
2019-03-28 08:16:47 +01:00
Dirk Ziegelmeier
d0d86b5ba1
Fix compile of last patch
2019-03-24 21:46:43 +01:00
Dirk Ziegelmeier
aa7009b2fc
Fix bug #55972 : The Neighbour Solicitation used to do IPv6 address resolution was wrong
...
Apply patch from Gao Qingshui
2019-03-24 21:34:08 +01:00
Dirk Ziegelmeier
4f6fd6c845
Fix bug #55973 : The parsing of max response time in MLD Query message was wrong
...
Apply patch from Gao Qingshui
2019-03-24 21:32:26 +01:00
Simon Goldschmidt
3b5eb7ca90
udp_bind: fix missing parenthesis warning
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-02-27 10:29:55 +01:00