From: Ondrej Zajicek Date: Thu, 27 Nov 2025 16:59:44 +0000 (+0100) Subject: RAdv: Fix flags for deprecated prefixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fbird.git RAdv: Fix flags for deprecated prefixes When a prefix is deprecated (valid_lifetime == 0), it should be announced with the same flags as before. The old code announced it without any flags, which leads to being ignored by recipients. Note that a prefix could be depreacted for two reason - it is removed from the interface, or it is deconfigured in BIRD configuration. Thanks to Michael Saxl for the bugreport. --- diff --git a/proto/radv/packets.c b/proto/radv/packets.c index 25f43b1a3..805ad20ce 100644 --- a/proto/radv/packets.c +++ b/proto/radv/packets.c @@ -307,9 +307,9 @@ radv_prepare_prefix(struct radv_iface *ifa, struct radv_prefix *px, op->type = OPT_PREFIX; op->length = 4; op->pxlen = px->prefix.pxlen; - op->flags = (pc->onlink ? OPT_PX_ONLINK : 0) | - (pc->autonomous ? OPT_PX_AUTONOMOUS : 0) | - (pc->pd_preferred ? OPT_PX_PD_PREFERRED : 0); + op->flags = (px->onlink ? OPT_PX_ONLINK : 0) | + (px->autonomous ? OPT_PX_AUTONOMOUS : 0) | + (px->pd_preferred ? OPT_PX_PD_PREFERRED : 0); op->valid_lifetime = (ifa->ra->active || !pc->valid_lifetime_sensitive) ? htonl(pc->valid_lifetime) : 0; op->preferred_lifetime = (ifa->ra->active || !pc->preferred_lifetime_sensitive) ? diff --git a/proto/radv/radv.c b/proto/radv/radv.c index ba31e1a84..19c8f64c5 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -161,6 +161,11 @@ radv_prepare_prefixes(struct radv_iface *ifa) existing->valid = 1; existing->changed = now; existing->mark = 1; + + existing->onlink = pc->onlink; + existing->autonomous = pc->autonomous; + existing->pd_preferred = pc->pd_preferred; + existing->cf = pc; } diff --git a/proto/radv/radv.h b/proto/radv/radv.h index 83491f47e..000721824 100644 --- a/proto/radv/radv.h +++ b/proto/radv/radv.h @@ -171,6 +171,10 @@ struct radv_prefix /* One prefix we advertise */ u8 valid; /* Is the prefix valid? If not, we advertise it with 0 lifetime, so clients stop using it */ u8 mark; /* A temporary mark for processing */ + u8 onlink; /* Flags copied from prefix config */ + u8 autonomous; + u8 pd_preferred; + btime changed; /* Last time when the prefix changed */ struct radv_prefix_config *cf; /* The config tied to this prefix */ };