diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-03-16 16:23:51 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-03-16 21:29:49 +0100 |
commit | fa92d38428cdac260e72e280bf1d43539f4ea805 (patch) | |
tree | c9a4017905be6f7c8be35d6ebae8d56a6b53a646 /src/libsystemd-network/dhcp6-option.c | |
parent | Merge pull request #19009 from poettering/one-more-cname-fix (diff) | |
download | systemd-fa92d38428cdac260e72e280bf1d43539f4ea805.tar.xz systemd-fa92d38428cdac260e72e280bf1d43539f4ea805.zip |
dhcp6: fix wrong length for IA_PD dhcp6 option
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.
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd-network/dhcp6-option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 9314016024..91162d636b 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -257,9 +257,9 @@ int dhcp6_option_append_pd(uint8_t **buf, size_t *buflen, const DHCP6IA *pd, con len += r; } - if (hint_pd_prefix) { + if (hint_pd_prefix && hint_pd_prefix->iapdprefix.prefixlen > 0) { r = option_append_pd_prefix(buf, buflen, hint_pd_prefix); - if (r < 0 && r != -EINVAL) + if (r < 0) return r; len += r; |