]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
RAdv: Fix flags for deprecated prefixes master
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 27 Nov 2025 16:59:44 +0000 (17:59 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 27 Nov 2025 16:59:44 +0000 (17:59 +0100)
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.

proto/radv/packets.c
proto/radv/radv.c
proto/radv/radv.h

index 25f43b1a3b5dae9114e53ab10ebe6a5124d34be9..805ad20ce8ca4b51a377d08e8158bd375dd7edd5 100644 (file)
@@ -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) ?
index ba31e1a845f2aed5af6bc73b1d4768f44a2fddde..19c8f64c50897b48eabccbcdf51534abb6dc0b07 100644 (file)
@@ -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;
   }
 
index 83491f47e94e596d2476d877df124d506fc44ce4..00072182481f10a9a6077dfeb7dbc01a3f51ab20 100644 (file)
@@ -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 */
 };