[RADV] prefix deprecation

Michael Saxl mike at mwsys.mine.bz
Thu Nov 20 13:18:06 CET 2025


Hello,

I'm doing some experiments using radv and bird3.
as expected it bird3 automatically sends prefix informations if not somehow disabled.

when I dynamically add a prefix to an interface (ip a a address/64 dev eno1) it immediatly blasts out that prefix with the default parameters (hardcoded in radv.c as radv_prefix_config default_prefix).

Now if that prefix is removed, this prefix is sent as valid_lifetime and preferred_lifetime = 0, but at least linux (NetworkManager) seems to ignore this deprecation, mainly because onlink and autonomous are not set.
As soon as I modify the code to do that, the prefix gets deprecated (valid_lifetime gets lower-limited to 7200 on the os side, I think strictly rfc valid_lifetime should also count down on bird starting at 7200, but in practice 0 seems to work too).

I've not tried all combinations, but the simplest fix for me is setting .onlink and .autonomous =1 in dead_prefix. I'm not sure if this does not break prefixes that are explicitly defined, so I did not modifiy dead_prefix but instead changed

  WALK_LIST_DELSAFE(pfx, next, ifa->prefixes)
  {
    if (pfx->valid && !pfx->mark)
    {
      RADV_TRACE(D_EVENTS, "Invalidating prefix %N on %s",
                 &pfx->prefix, ifa->iface->name);

      pfx->valid = 0;
      pfx->changed = now;
      struct radv_prefix_config *pc = radv_prefix_match(ifa, &pfx->prefix);
      if(pc)
        pfx->cf = pc;
      else 
        pfx-cv = &dead_prefix;
    }
  }

and in packet.c funtion radv_prepare_prefix I changed

  if (!px->valid) {
    ifa->valid_time = MIN(ifa->valid_time, px->changed + ifa->cf->prefix_linger_time S);
    op->preferred_lifetime = 0;
    op->valid_lifetime = 0; // might need to be >7200s, see RFC4862 section 5.5.3 e
  }

What do you think about this changes?

Regards

Michael




More information about the Bird-users mailing list