| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes #25988.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the maximum packet size was hardcoded with 512 + size of
the DHCP header. This makes the packet size increased when necessary.
See option_append_hdr().
Previously, all functions which append DHCP options took the head of the
unused area of the packet, and the size of the free area.
However, with this change, the buffer for the whole packet may be
reallocated, hence now they take the head of the packet and the offset
to the free area.
Fixes #24851.
|
| |
|
|
|
|
| |
And merge 'total' and 'offset' -> 'n'
|
| |
|
| |
|
|
|
|
| |
length value gracefully
|
| |
|
|
|
|
|
|
|
| |
This fixes error in parsing message when the rapid commit option is
located at the end of the message.
Fixes an issure reported in #24002.
|
| |
|
|
|
|
|
| |
Even though these options are not currently used by sd-dhcp6-client,
RFC 8415 states these options MUST be requested.
|
| |
|
| |
|
|
|
|
| |
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
|
| |
|
|
|
|
| |
To make them follow corresponding DHCPv4 options.
|
| |
|
|
|
|
| |
Also, this moves string tables to dhcp6-protocol.c.
|
|
|
|
| |
This also fixes memleak.
|
| |
|
| |
|
| |
|
|
|
|
| |
And allows to specify multiple hints.
|
| |
|
|
|
|
| |
This also fixes possible unaligned read of message.
|
|
|
|
|
| |
If the condition hits, then it is an error in coding, instead of a user
misconfiguration or invalid receivd message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've seen this in `NetworkManager-1.34.0-0.3.el8.x86_64` (latest in CentOS
Stream 8 at the time of writing this message) which does not use the latest
Systemd but probably the code base is the same (see
https://github.com/NetworkManager/NetworkManager/commit/51f93e00a23fbd09f5ad96da6290bf4ca737d46a).
Before the patch:
```
libsystemd: eth0: DHCPv6 client: T1 expires in 34y 3w 6d 45min 31s
libsystemd: eth0: DHCPv6 client: T2 expires in 54y 5month 3w 3d 23h 20min 35s
```
After the patch:
```
libsystemd: eth0: DHCPv6 client: T1 expires in 3d 7h 58min 3s
libsystemd: eth0: DHCPv6 client: T2 expires in 5d 2h 26min 50s
```
same box (x86_64 system) and same DHCPv6 server.
This regression has likely been introduced by 8a8955507af363c31297bbc5df79852db4ad39d6.
|
| |
|
| |
|
| |
|
|
|
|
| |
dhcp6_option_parse_domainname()/domainname_list()
|
|
|
|
|
|
|
| |
GREEDY_REALLOC() takes number of elements, not buffer size.
This also rename dhcp6_option_parse_ip6addrs() to
dhcp6_option_parse_addresses().
|
|
|
|
|
|
|
|
| |
This makes
- the function not update the arguments for storing results on error,
- use dhcp6_option_parse() to parse sub options,
- ignore all errors, except for -ENOMEM, in parsing sub options,
- update log messages.
|
|
|
|
|
|
|
| |
This also introduce dhcp6_option_parse_ia_options(). Currently, it is
assumed that each IA address or PD prefix may contain a status sub-option.
But it is not prohibited that other sub-options or multiple status
options are contained.
|
|
|
|
|
|
|
| |
- merge dhcp6_option_parse() with option_parse_hdr().
- do not assign/update any values on error.
- use assert() instead of assert_return(), as the assertions cannot
be triggered by a library user.
|
| |
|
|
|
|
|
|
| |
But do not refuse whole message.
Fixes #20803.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We recently started making more use of malloc_usable_size() and rely on
it (see the string_erase() story). Given that we don't really support
sytems where malloc_usable_size() cannot be trusted beyond statistics
anyway, let's go fully in and rework GREEDY_REALLOC() on top of it:
instead of passing around and maintaining the currenly allocated size
everywhere, let's just derive it automatically from
malloc_usable_size().
I am mostly after this for the simplicity this brings. It also brings
minor efficiency improvements I guess, but things become so much nicer
to look at if we can avoid these allocation size variables everywhere.
Note that the malloc_usable_size() man page says relying on it wasn't
"good programming practice", but I think it does this for reasons that
don't apply here: the greedy realloc logic specifically doesn't rely on
the returned extra size, beyond the fact that it is equal or larger than
what was requested.
(This commit was supposed to be a quick patch btw, but apparently we use
the greedy realloc stuff quite a bit across the codebase, so this ends
up touching *a*lot* of code.)
|
| |
|
|\
| |
| | |
network: set ifname to dhcp4 client or friends
|
| |
| |
| |
| |
| | |
Only when T1 and T2 are both 0, they are adjusted later based on
address or prefix T1 and T2. So the first check must be changed.
|
| | |
|
|/
|
|
|
|
|
|
|
| |
Fixes an issue introduced by 73b49d433c2c8e6304c8b82538bd4231d070fce4.
When PrefixDelegationHint= is not set, dhcp6_option_append_pd() sets
wrong length for IA_PD option, as `r` is `-EINVAL`.
Fixes #19021.
|
|
|
|
| |
Fixes #18090.
|
| |
|
|
|
|
|
|
|
| |
received address or prefix is refused
And then the caller ignores the error.
Otherwise, `ret_liftime_valid` is not set even if they succeeds.
|
| |
|
|
|
|
|
| |
Also, fixes the maximum length of the vendor class to UINT16_MAX.
Moreover, a memory leak in sd_dhcp6_client_set_request_vendor_class().
|
|
|
|
|
| |
This also fixes a memory leak when
sd_dhcp6_client_set_request_user_class() is called multiple times.
|