From 16d7a18441ef8f3073b362a8b98cd4d6cc02e4d2 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Thu, 30 Nov 2023 20:55:54 +0100 Subject: dbi: og_computer_get_info() uses netmask field in 'room' table netmask field in 'computers' table is never used, but ogcli still displays it through: # ogcli list client --client-ip 1.2.3.4 and it shows '0' or incorrect netmask (ogCP hardcodes this field). Update SQL query to fetch the room.netmask instead. --- src/dbi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbi.c b/src/dbi.c index ba4c113..0c7f030 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -69,7 +69,6 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer, " ordenadores.idaula," " ordenadores.idperfilhard," " ordenadores.idrepositorio," - " ordenadores.mascara," " ordenadores.arranque," " ordenadores.netiface," " ordenadores.netdriver," @@ -78,6 +77,7 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer, " ordenadores.inremotepc," " ordenadores.maintenance," " ordenadores.identorno," + " aulas.netmask," " centros.idcentro " "FROM ordenadores " "INNER JOIN aulas ON aulas.idaula=ordenadores.idaula " @@ -111,7 +111,7 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer, computer->hardware_id = dbi_result_get_uint(result, "idperfilhard"); computer->repo_id = dbi_result_get_uint(result, "idrepositorio"); snprintf(computer->netmask, sizeof(computer->netmask), "%s", - dbi_result_get_string(result, "mascara")); + dbi_result_get_string(result, "netmask")); snprintf(computer->boot, sizeof(computer->boot), "%s", dbi_result_get_string(result, "arranque")); snprintf(computer->netiface, sizeof(computer->netiface), "%s", -- cgit v1.2.3-18-g5258