1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

51 Commits

Author SHA1 Message Date
Teufelchen1
f88285de75 net/dhcpv6: Improve option parsing in dhcpv6 advertise 2024-10-02 09:47:22 +02:00
Bennet Blischke
cc9855b3ae net/dhcpv6: Improve option handling in dhcpv6 advertise 2024-07-30 19:21:09 +02:00
Benjamin Valentin
312a550f1a treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Benjamin Valentin
0a453ae679 sys/net/dhcpv6: let dhcpv6_client_req_ia_pd() return error 2023-02-01 23:25:22 +01:00
Benjamin Valentin
54fe031705 sys/net/dhcpv6: add IA Prefix Option in SOLICIT
Add the IA Prefix Option when soliciting a prefix so we can tell the
server what prefix length we want.
2023-02-01 23:25:22 +01:00
Sören Tempel
498e531e2f dhcpv6: don't treat zero option as an end-of-payload marker
As far as I can tell, no DHCPv6 RFC specifies this option. The handling
for the zero option was added in #17736 by @benpicco to fix issues
encountered while trying to retrieve a DHCHPv6 lease. However, I
strongly suspect that the zero option was encountered in this case due
to an out-of-bounds read performed in RIOT's DHCPv6 client
implementation (i.e. the option parsing loop read beyond the packet
bounds). This issue was fixed in #18307 and I strongly suspect that it
should also fix the issue @benpicco originally encountered in #17736. As
such, I propose that we remove the if statement which treats the zero
option as an end-of-payload marker.

Fixes #18309
2022-09-22 20:08:00 +02:00
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
Sören Tempel
f073dcdb3d gnrc_dhcpv6_client: Fix out-of-bounds access during option parsing
The _parse_reply function iterates over the DHCPv6 message options
twice but only performs sanity checks on the option length in the
first iteration. As such, both loop iterations need to be identical.
Unfortunately, there aren't without this commit as (1) they use
different maximum length values and (2) the first iteration stops
parsing as soon as it encounters a zero option while the second
doesn't. As such, it is possible for out-of-bounds read to be
performed by the second loop iteration. This commit fixes this.
2022-07-11 22:55:33 +02:00
Benjamin Valentin
37a4fffb17 sys/net/dhcpv6: consider option 0 an end marker
The REPLY of a TP-Link router (WR400 v4.20) ends with a 0 option
that has a bogus length.
When subtracting the length from the remaining length, we get an
underflow (remaining `len` is 3, option len is 4).

To get a working DHCP response, consider 0 (Reserved) an end marker.
2022-03-28 14:53:00 +02:00
Benjamin Valentin
922a1d7c9a sys/net/dhcpv6: make sanity check more lenient
If we did not enable downstream interfaces yet but have IA_PD enabled
or if we did not configure an interface for IA_NA but have the module
enabled, don't discard the DHCP reply.

If a server does not support an option it will respond with an error
code.
2022-03-28 14:52:59 +02:00
Karl Fessel
35107ec4ba sys/net: add missing includes 2022-02-28 14:53:07 +01:00
Jan Romann
e185a2556d
sys/net/dhcpv6: fix variable shadowing issue 2022-01-01 18:43:13 +01:00
Martine Lenders
b1b0a9b4f5
dhcpv6_client: add comment on why the division is needed 2021-10-15 17:36:13 +02:00
Martine Lenders
d844de2263
dhcpv6_client: keep integers in retransmission calculations signed 2021-10-15 17:35:46 +02:00
Jan Romann
c62d6eb834
sys/net/dhcpv6: Implement stateless DHCPv6 2021-10-04 17:40:56 +02:00
Jan Romann
507d39c054
sys/net/dhcpv6: Reformat parsing of IA_NA 2021-09-01 01:24:56 +02:00
Jan Romann
18dd056f8a
sys/net/dhcpv6: Add missing IA_NA IS_USED check 2021-08-18 02:03:56 +02:00
Jan Romann
192e09b7bf
sys/net/dhcpv6: Refactor update of leases 2021-08-18 02:00:12 +02:00
Jan Romann
d0dd12cf25
sys/net/dhcpv6: Refactor parsing of IA_PD 2021-08-18 02:00:11 +02:00
Jan Romann
1daa4b6e30
sys/net/dhcpv6: Refactor message composition 2021-08-18 02:00:08 +02:00
Jan Romann
bbce04f854
sys/net/dhcpv6: Refactor mrd calculation 2021-08-18 02:00:08 +02:00
Jan Romann
ad0096cde6
sys/net/dhcpv6: Refactor IA_NA implementation 2021-08-11 22:19:59 +02:00
Martine Lenders
f2f6700865
Merge pull request #16228 from JKRhb/dhcp-ia-na
sys/net/dhcpv6: Add IA_NA support to the DHCPv6 client
2021-08-11 20:50:01 +02:00
Jan Romann
234a71870a
sys/net/dhcpv6: Add IA_NA implementation 2021-08-11 19:15:35 +02:00
Martine Lenders
2d7c613948
tests/gnrc_dhcpv6_relay: initial import 2021-08-11 14:30:37 +02:00
Martine Lenders
4afc65688f
dhcpv6_relay: initial import of a lightweight DHCPv6 relay agent 2021-08-11 13:19:06 +02:00
Karl Fessel
238c759899 dhcpv6_client: mrd calculation fixed for renew and rebind
mrd calculation for dhcp-renew was wrong this fixes it
and the logic for dhcp rebind mrd handling
    (try rebind if ther is mrd)
see issue  #16677
2021-07-23 17:54:55 +02:00
Martine Lenders
6493241ed4
dhcpv6_client: add ztimer backend support 2021-07-21 16:28:39 +02:00
Martine Lenders
b5d9f78cbd
dhcpv6_client: port timeout mechanism to event_timeout 2021-07-21 16:28:39 +02:00
Martine Lenders
805952c5ce
dhcpv6_client: use event_timeout instead of xtimer 2021-07-21 16:28:37 +02:00
Martine Lenders
ed9a682e49
dhcpv6_client: set timer by unit rather than integer width 2021-07-21 16:27:54 +02:00
Martine Lenders
d1613da617
dhcpv6_client: use milliseconds rather than microseconds as base unit 2021-07-21 16:27:54 +02:00
Martine Lenders
eb577c933e
dhcpv6_client: move timer setting to their own functions 2021-07-21 16:27:53 +02:00
Martine Lenders
38d14b6335
dhcpv6_client: make IA_PD an optional module
Prefix delegation used to be the only supported feature of our DHCPv6
client, but by now it also supports MUD, DNS recursive name servers and
IA_NA is on the horizon. So it makes sense to make IA_PD an optional
module like all those other features are as well.
2021-07-21 11:37:29 +02:00
Martine Lenders
d9be29318d
gnrc_dhcpv6_client_mud_url: rename to dhcpv6_client_mud_url
There is no real reason for that pseudo-module to use the `gnrc_`
prefix. Neither does it need GNRC-components (except, but optionally, as
a network stack of course), nor is it implemented with in the GNRC
network stack.
2021-07-20 15:30:34 +02:00
Martine Lenders
4deb15cb6f
dhcpv6_client: add DNS recursive name server option handling
Signed-off-by: Martine Lenders <m.lenders@fu-berlin.de>
2021-06-24 16:01:59 +02:00
Jan Romann
6a2aa7ad52 sys/net/dhcpv6: Fix MUD URL option 2021-02-09 19:47:47 +01:00
Jan Romann
9823e45a93 net/dhcpv6: Introduce buffer size check 2020-11-30 22:46:33 +01:00
Jan Romann
2a570cb957 net/dhcpv6: Add DHCPv6 option for MUD URL (RFC 8520)
Co-Authored-By: Jens Bücker <48720000+jbueck@users.noreply.github.com>
Co-Authored-By: mauspr <75017188+mauspr@users.noreply.github.com>
Co-Authored-By: schulztr <75017039+schulztr@users.noreply.github.com>
2020-11-30 22:46:33 +01:00
Bas Stottelaar
922e2ac1c9 sys/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:49:39 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Bas Stottelaar
80d9da90df sys/*: add missing include of assert.h 2020-10-22 11:13:09 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Akshai M
0413a5881f net/dhcpv6 : Expose to Kconfig
Expose configurations to Kconfig. Add conditional CFLAGS to avoid
conflicts with Kconfig.
2020-07-24 00:23:08 +05:30
Akshai M
1c37e11c0e net/dhcpv6 : Move 'DHCPV6_CLIENT_PFX_LEASE_MAX' to 'CONFIG_' 2020-07-23 21:10:26 +05:30
Benjamin Valentin
2d1160426d sys/net/dhcpv6: discard stale replies
The DHCPv6 server might send reponses multiple times.
The DHCPv6 client will only handle the first response, if additional
responses are comming in they are left in the RX queue.

That results in the client always reading the response of a previous
transaction on any subsequent transactions.
In this case the client will try again, creating a new transaction - that
will again only read the previous response.

To fix this, discard previous responses by flushing the RX queue before
sending a new message to the DHCPv6 server.

fixes #13834
2020-06-21 22:07:32 +02:00
Benjamin Valentin
0e5595cffd sys/net/dhcpv6: fix requesting multiple prefixes
There were two subtle bugs that prevented the DHCPv6 client to request
multiple prefixes for different interfaces.

 - `dhcpv6_client_req_ia_pd()` would fill up *all* leases with the same interface
 - `_parse_reply()` would return after parsing the first answer

With this patch, `gnrc_border_router` gets a prefix on both interfaces of the at86rf215.
2020-04-03 17:02:57 +02:00
Gunar Schorcht
a25c61bc8b sys/net/dhcpv6: fix client option length handling 2020-03-12 18:33:17 +01:00
Martine S. Lenders
b929d013d8
dhcpv6_client: re-send SOLICITs after failed ADVERTISE 2020-02-20 16:41:48 +01:00