diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2023-11-30 20:55:54 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2023-11-30 20:58:04 +0100 |
commit | 16d7a18441ef8f3073b362a8b98cd4d6cc02e4d2 (patch) | |
tree | 2b1598a43aae8429c5f9fd818f2943c43d0aaacf /src | |
parent | edac32bb986e8dab23a14a79317c2109bc523270 (diff) |
dbi: og_computer_get_info() uses netmask field in 'room' tablev1.2.5-4
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/dbi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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", |