]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
RAdv: Fix flags for deprecated prefixes
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 27 Nov 2025 16:59:44 +0000 (17:59 +0100)
committerMaria Matejka <mq@ucw.cz>
Tue, 2 Dec 2025 13:40:15 +0000 (14:40 +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.

Fixes: #323
proto/radv/packets.c
proto/radv/radv.c
proto/radv/radv.h

index 77c9879492582e8428522c461b8ff317f8415199..8b060a206525d621e7ca641cb6cf6d7c7659751a 100644 (file)
@@ -306,8 +306,8 @@ 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);
+  op->flags = (px->onlink ? OPT_PX_ONLINK : 0) |
+             (px->autonomous ? OPT_PX_AUTONOMOUS : 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..4ff075713558c1188cf6216174feb5e78624f415 100644 (file)
@@ -161,6 +161,10 @@ 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->cf = pc;
   }
 
index ba4a1b6c75eb680e393dbb8eca0505c9998529a0..d4d3a50f30b42e4c1177ca78493e623f478e499b 100644 (file)
@@ -170,6 +170,9 @@ 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;
+
   btime changed;               /* Last time when the prefix changed */
   struct radv_prefix_config *cf; /* The config tied to this prefix */
 };