From: Roy Marples Date: Sat, 13 Sep 2025 11:45:50 +0000 (+0100) Subject: ND Route Information Option prefix is optional X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6dcb1569fc782a8f8a5e8855faee5aadcc769554;p=thirdparty%2Fdhcpcd.git ND Route Information Option prefix is optional As the length could be zero and is RFC compliant. Fixes #527. --- diff --git a/src/dhcpcd-definitions-small.conf b/src/dhcpcd-definitions-small.conf index 2f231286..0c874ae1 100644 --- a/src/dhcpcd-definitions-small.conf +++ b/src/dhcpcd-definitions-small.conf @@ -74,7 +74,7 @@ embed byte length # bits 4 and 5 are route preference embed bitflags=00011 prf embed uint32 lifetime -embed truncated ip6address prefix +embed optional truncated ip6address prefix # ND6 options, RFC6101 definend 25 index embed rdnss diff --git a/src/dhcpcd-definitions.conf b/src/dhcpcd-definitions.conf index 5c9230de..e350aa9f 100644 --- a/src/dhcpcd-definitions.conf +++ b/src/dhcpcd-definitions.conf @@ -417,7 +417,7 @@ embed byte length # bits 4 and 5 are route preference embed bitflags=00011 prf embed uint32 lifetime -embed truncated ip6address prefix +embed optional truncated ip6address prefix # ND6 options, RFC6101 definend 25 index embed rdnss diff --git a/src/if-options.c b/src/if-options.c index 3cb89f35..2819113d 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -2093,7 +2093,7 @@ err_sla: t |= OT_RESERVED; } } - if (t & OT_TRUNCATED && t != (OT_ADDRIPV6 | OT_TRUNCATED)) { + if (t & OT_TRUNCATED && !(t & OT_ADDRIPV6)) { logerrx("truncated only works for ip6address"); return -1; }