ready to compare host and dns AAAA values

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-06 19:00:51 -06:00
parent 0148cec0b2
commit 53fbb4cb85
3 changed files with 24 additions and 2 deletions

15
fix.go
View File

@ -35,10 +35,21 @@ func fix() bool {
} }
if ! me.status.IPv6() { if ! me.status.IPv6() {
log.Warn("IPv6 DNS is broken. Check what is broken here") log.Warn("IPv6 DNS is broken. Check what is broken here")
log.Warn("What are my IPv6 addresses?") fixIPv6dns()
log.Warn("What are the AAAA resource records in DNS?")
return false return false
} }
log.Warn("YOU SHOULD BE IN IPv6 BLISS") log.Warn("YOU SHOULD BE IN IPv6 BLISS")
return true return true
} }
func fixIPv6dns() {
log.Warn("What are my IPv6 addresses?")
for _, aaaa := range me.statusOS.GetIPv6os() {
log.Warn("FOUND AAAA ip", aaaa)
}
log.Warn("What are the AAAA resource records in DNS?")
for _, aaaa := range me.status.GetIPv6dns() {
log.Warn("FOUND AAAA ip", aaaa)
}
}

View File

@ -279,6 +279,11 @@ func (hs *hostnameStatus) missingAAAA() bool {
} }
*/ */
func (hs *hostnameStatus) GetIPv6dns() []string {
tmp := hs.dnsAAAA.Get()
return strings.Split(tmp, "\n")
}
func (hs *hostnameStatus) updateStatus() { func (hs *hostnameStatus) updateStatus() {
if ! hs.Ready() { return } if ! hs.Ready() { return }
var s string var s string

View File

@ -3,6 +3,7 @@
package linuxstatus package linuxstatus
import ( import (
"strings"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/shell" "go.wit.com/shell"
@ -64,6 +65,11 @@ func (ls *LinuxStatus) setHostShort() {
} }
} }
func (ls *LinuxStatus) GetIPv6os() []string {
tmp := me.workingIPv6.Get()
return strings.Split(tmp, "\n")
}
func lookupHostname() { func lookupHostname() {
if ! me.Ready() {return} if ! me.Ready() {return}
var err error var err error