Do not include clients already configured in gravity.client

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2024-10-26 11:05:12 +02:00
parent 148e558fd1
commit 1f435afa8d
+1 -1
View File
@@ -369,6 +369,7 @@ int api_client_suggestions(struct ftl_conn *api)
"FROM network_addresses na "
"WHERE na.network_id = n.id) "
"FROM network n "
"WHERE n.hwaddr NOT IN (SELECT CONCAT('ip-',lower(ip)) FROM g.client)"
"ORDER BY lastQuery DESC LIMIT ?";
if(sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) != SQLITE_OK)
@@ -428,4 +429,3 @@ int api_client_suggestions(struct ftl_conn *api)
JSON_ADD_ITEM_TO_OBJECT(json, "clients", clients);
JSON_SEND_OBJECT(json);
}