ND Route Information Option prefix is optional

As the length could be zero and is RFC compliant.
Fixes #527.
This commit is contained in:
Roy Marples 2025-09-13 12:45:50 +01:00
parent 4b7065a78f
commit 6dcb1569fc
3 changed files with 3 additions and 3 deletions

View 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

View 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

View 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;
}