From d1d5e15cca9e0a3204332632f76fc39e7e5bbee0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 7 Jan 2024 07:21:36 -0600 Subject: [PATCH] fix real IPv4 display Signed-off-by: Jeff Carr --- linuxstatus/hostname.go | 7 ------- linuxstatus/net.go | 10 ++++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/linuxstatus/hostname.go b/linuxstatus/hostname.go index 184e593..2a83eba 100644 --- a/linuxstatus/hostname.go +++ b/linuxstatus/hostname.go @@ -3,7 +3,6 @@ package linuxstatus import ( - "strings" "io/ioutil" "go.wit.com/log" @@ -65,12 +64,6 @@ func (ls *LinuxStatus) setHostShort() { } } -func (ls *LinuxStatus) GetIPv6() []string { - if ! me.Ready() {return nil} - tmp := me.workingIPv6.Get() - return strings.Split(tmp, "\n") -} - func lookupHostname() { if ! me.Ready() {return} var err error diff --git a/linuxstatus/net.go b/linuxstatus/net.go index 7170765..22c9a4c 100644 --- a/linuxstatus/net.go +++ b/linuxstatus/net.go @@ -270,9 +270,15 @@ func deleteChanges() bool { return changed } -func (ls *LinuxStatus) GetIPv4() []string { +func (ls *LinuxStatus) GetIPv6() []string { if ! me.Ready() {return nil} - tmp := "(none) fixme" + tmp := me.workingIPv6.Get() + return strings.Split(tmp, "\n") +} + +func (ls *LinuxStatus) GetIPv4() []string { + if ! me.Ready() {return nil} + tmp := me.workingIPv4.Get() return strings.Split(tmp, "\n") }