summaryrefslogtreecommitdiffstats
path: root/server/api/registration.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/api/registration.js')
-rw-r--r--server/api/registration.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/api/registration.js b/server/api/registration.js
index 1b5a6d1..5d161b7 100644
--- a/server/api/registration.js
+++ b/server/api/registration.js
@@ -683,12 +683,15 @@ async function parseHardwareInformation (data) {
/* Get network information as fallback for ip */
if (client.networks.length <= 0) {
for (let key in data.net) {
+ // IP v4 and v6 comes with the netmask, so the last 3 chars need to be cut
+ const ipv4 = data.net[key]['ipv4']
+ const ipv6 = data.net[key]['ipv6']
let network = {
'name': key,
'mac': data.net[key]['mac'],
- 'ip': data.net[key]['ipv4'],
- 'ipv6': data.net[key]['ipv6'],
- 'hostname': ''
+ ...(ipv4 && { 'ip': ipv4.substring(0, ipv4.length - 3) }),
+ ...(ipv6 && { 'ipv6': ipv6.substring(0, ipv6.length - 3) }),
+ 'hostname': undefined
}
client.networks.push(network)
}