Advertise desktop clients and log unknown automatic candidates

This commit is contained in:
evgeny committed 2026-10-02 11:47:24 +03:00
1 parent dc34faaada
commit 1d189195f9
2 files changed
+9

No files matched your search

+7
View File
@@ -98,6 +98,7 @@ static int tgc_load(struct TOPO_GROUP_CONNECT* gc) {
int self_super = 0;
for (size_t i = 0; i < count; i++) {
if (peers[i].node_id == group->instance->node_id) { self_super = peers[i].supernode; continue; }
size_t previous_count = gc->count;
struct tgc_candidate* c = tgc_add(gc, peers[i].node_id);
if (!c) { u_free(peers); return -1; }
uint8_t device = peers[i].client_type;
@@ -105,6 +106,9 @@ static int tgc_load(struct TOPO_GROUP_CONNECT* gc) {
if (node && node->timestamp) device = node->client_type;
uint8_t kind = peers[i].supernode ? TGC_SUPER : device == CLIENT_TYPE_DESKTOP ? TGC_DESKTOP :
device == CLIENT_TYPE_MOBILE ? TGC_MOBILE : TGC_UNKNOWN;
if (kind == TGC_UNKNOWN && gc->count != previous_count)
DEBUG_WARN(DEBUG_CATEGORY_BGP, "group candidate skipped: group=%016llx node=%016llx device=%u no supernode role",
(unsigned long long)group->group_id, (unsigned long long)c->node_id, device);
if (c->kind != kind) {
DEBUG_INFO(DEBUG_CATEGORY_BGP, "group candidate class: group=%016llx node=%016llx %s->%s device=%u",
(unsigned long long)group->group_id, (unsigned long long)c->node_id,
@@ -165,11 +169,13 @@ static void tgc_cancel_pause(struct TOPO_GROUP_CONNECT* gc) {
gc->pause_wait = NULL; gc->paused = 0;
}
#ifdef UTUN_HAVE_STANDBY
static void tgc_resume(void* arg) {
struct TOPO_GROUP_CONNECT* gc = arg;
gc->pause_wait = NULL; gc->paused = 0;
topo_group_connect_changed(gc->group);
}
#endif
static int tgc_pause(struct TOPO_GROUP_CONNECT* gc) {
#ifdef UTUN_HAVE_STANDBY
@@ -179,6 +185,7 @@ static int tgc_pause(struct TOPO_GROUP_CONNECT* gc) {
DEBUG_WARN(DEBUG_CATEGORY_BGP, "cannot wait for standby; using group retry timer");
}
#endif
(void)gc;
return 0;
}