summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2023-11-30 20:55:54 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2023-11-30 20:58:04 +0100
commit16d7a18441ef8f3073b362a8b98cd4d6cc02e4d2 (patch)
tree2b1598a43aae8429c5f9fd818f2943c43d0aaacf
parentedac32bb986e8dab23a14a79317c2109bc523270 (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.
-rw-r--r--src/dbi.c4
1 files 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",