]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ND Route Information Option prefix is optional optional
authorRoy Marples <roy@marples.name>
Sat, 13 Sep 2025 11:45:50 +0000 (12:45 +0100)
committerRoy Marples <roy@marples.name>
Sat, 13 Sep 2025 11:45:50 +0000 (12:45 +0100)
As the length could be zero and is RFC compliant.
Fixes #527.

src/dhcpcd-definitions-small.conf
src/dhcpcd-definitions.conf
src/if-options.c

index 2f2312860431dcb810fa2094e54beeb50997f3ad..0c874ae115c3562bfc45cb70ba6638b401d4fa69 100644 (file)
@@ -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
index 5c9230de2d7f995bd4730bc5ff640eaa0405a9ab..e350aa9f402c9093620db961d73cc9aac8a37375 100644 (file)
@@ -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
index 3cb89f35e651f4e7730d18d94cb2bb7f0571af38..2819113d382745f86aedd0b221a35c7815c40a75 100644 (file)
@@ -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;
                }