On Wed, Jul 06, 2022 at 05:07:45PM +0200, Claudio Jeker wrote:
> This diff changes various loops which call into up_generate_update() so
> that all these loops call the same function peer_generate_update() which
> then calls up_generate_update(). This is a step to add an alternative path
> to generate updates for add-path send support without altering many
> code-paths.
>
> If I did not fool myself this should not alter current behaviour.
> rde_up_dump_upcall() gets a few more checks but all those checks should be
> false in this case (e.g. peer_dump checks the export_type already).
This looks good and I agree that the behavior is mostly preserved. I
noticed are two changes of behavior and I have a small question for
rde_up_dump_upcall():
> @@ -317,20 +374,10 @@ rde_up_dump_upcall(struct rib_entry *re,
> struct rde_peer *peer = ptr;
> struct prefix *p;
>
> - if (peer->state != PEER_UP)
> - return;
> - if (re->rib_id != peer->loc_rib_id)
> - fatalx("%s: Unexpected RIB %u != %u.", __func__, re->rib_id,
> - peer->loc_rib_id);
Failure of this check will now be silent.
> - if (peer->capa.mp[re->prefix->aid] == 0)
> - fatalx("%s: Unexpected %s prefix", __func__,
> - aid2str(re->prefix->aid));
Same here.
I got lost when checking that re->prefix->aid == p->pt->aid. I assume
that follows from the definition of the rib_entry's prefix queue?
> -
> /* no eligible prefix, not even for 'evaluate all' */
> if ((p = prefix_best(re)) == NULL)
> return;
> -
> - up_generate_updates(out_rules, peer, p, NULL);
> + peer_generate_update(peer, re->rib_id, p, NULL, 0);
> }
>
> static void