SCRATCH: squash with following commit.

This commit alone is insufficient. The complexity of the following
commit is necessary, to flag who created a ObjStateData ("os_dynamic"
and "os_non_dynamic"). Without it, on each commit the object state will
be removed again.

WAS:
==============

l3cfg: track obj-state for single-hop route after ECMP commit

Before ECMP commit we don't know if the single-hop route is going to be
merged as ECMP multi-hop route. Therefore if the route has a weight
bigger than zero, it is going to be tracked only after the ECMP commit.
This commit is contained in:
Fernando Fernandez Mancera 2023-11-24 14:46:27 +01:00 committed by Thomas Haller
parent a6e2996dbb
commit e909b63a23
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1064,7 +1064,12 @@ _obj_states_update_all(NML3Cfg *self)
/* this is a nodev route. We don't track an obj-state for this. */
continue;
}
if (obj_type == NMP_OBJECT_TYPE_IP4_ROUTE
&& NMP_OBJECT_CAST_IP4_ROUTE(obj)->weight > 0) {
/* this route weight is bigger than 0, that means we don't know
* which kind of route this will be. It can only be determined during commit. */
continue;
}
obj_state = g_hash_table_lookup(self->priv.p->obj_state_hash, &obj);
if (!obj_state) {
_obj_states_track_new(self, obj);
@ -1279,6 +1284,11 @@ loop_done:
if (singlehop_routes) {
for (i = 0; i < singlehop_routes->len; i++) {
const NMPObject *obj = singlehop_routes->pdata[i];
ObjStateData *obj_state;
obj_state = g_hash_table_lookup(self->priv.p->obj_state_hash, &obj);
if (!obj_state)
_obj_states_track_new(self, obj);
if (!_obj_states_sync_filter(self, obj, commit_type))
continue;