On Tue, Mar 15, 2022 at 12:21:00PM +0100, Claudio Jeker wrote:
> This diff just refactors the code by moving the alloc part up.
> It makes the code a bit easier to read and more similar with other
> prefix_adjout functions. Also I plan to pass the struct prefix in
> as an argument and do the prefix_adjout_get() in the callee.
ok
> @@ -1222,6 +1186,40 @@ prefix_adjout_update(struct rde_peer *pe
> if (RB_INSERT(prefix_index, &peer->adj_rib_out, p) != NULL)
> fatalx("%s: RB index invariant violated", __func__);
> }
> +
> + if ((p->flags & PREFIX_FLAG_ADJOUT) == 0)
> + fatalx("%s: prefix without PREFIX_FLAG_ADJOUT hit", __func__);
> + if ((p->flags & (PREFIX_FLAG_WITHDRAW | PREFIX_FLAG_DEAD)) == 0) {
> + if (prefix_nhflags(p) == state->nhflags &&
> + prefix_nexthop(p) == state->nexthop &&
> + communities_equal(&state->communities,
> + prefix_communities(p)) &&
> + path_compare(&state->aspath, prefix_aspath(p)) ==
> + 0) {
0) { fits on the previous line.