node: save created time for node

Save the timestamp of the node creation. This is required to optimize
the selection of most-roamed to neighbors relative to their creation
time.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2021-09-29 19:05:44 +02:00
parent a5c21aec7a
commit d0cd65b762
3 changed files with 4 additions and 0 deletions

View File

@@ -409,6 +409,7 @@ usteer_get_node(struct ubus_context *ctx, const char *name)
ln = calloc_a(sizeof(*ln), &str, strlen(name) + 1);
node = &ln->node;
node->type = NODE_TYPE_LOCAL;
node->created = current_time;
node->avl.key = strcpy(str, name);
ln->ev.remove_cb = usteer_handle_remove;
ln->ev.cb = usteer_handle_event;