X Tutup
Skip to content

Commit fa92d38

Browse files
yuwatapoettering
authored andcommitted
dhcp6: fix wrong length for IA_PD dhcp6 option
Fixes an issue introduced by 73b49d4. When PrefixDelegationHint= is not set, dhcp6_option_append_pd() sets wrong length for IA_PD option, as `r` is `-EINVAL`. Fixes systemd#19021.
1 parent 69bedd0 commit fa92d38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsystemd-network/dhcp6-option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ int dhcp6_option_append_pd(uint8_t **buf, size_t *buflen, const DHCP6IA *pd, con
257257
len += r;
258258
}
259259

260-
if (hint_pd_prefix) {
260+
if (hint_pd_prefix && hint_pd_prefix->iapdprefix.prefixlen > 0) {
261261
r = option_append_pd_prefix(buf, buflen, hint_pd_prefix);
262-
if (r < 0 && r != -EINVAL)
262+
if (r < 0)
263263
return r;
264264

265265
len += r;

0 commit comments

Comments
 (0)
X Tutup