Compare commits

..

3 Commits

Author SHA1 Message Date
amery 70411a2aab dns/show: sort records
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-10-24 17:13:12 +00:00
amery c94fa1770c dns/show: refactor Record formatting
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-10-24 17:13:12 +00:00
amery b6750f8b28 dns/sync: remove redundant suffix check
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-10-24 17:13:12 +00:00
+1 -9
View File
@@ -4,7 +4,6 @@ import (
"context"
"net/netip"
"sort"
"strings"
"time"
"darvaza.org/core"
@@ -58,7 +57,7 @@ func (mgr *Manager) GetSyncRecords(ctx context.Context) ([]SyncAddrRecord, error
}
// AsSyncAddr converts a A or AAAA [libdns.Record] into a [SyncAddr]
func (mgr *Manager) AsSyncAddr(rr libdns.Record) (SyncAddr, bool, error) {
func (*Manager) AsSyncAddr(rr libdns.Record) (SyncAddr, bool, error) {
var out SyncAddr
var addr netip.Addr
@@ -67,13 +66,6 @@ func (mgr *Manager) AsSyncAddr(rr libdns.Record) (SyncAddr, bool, error) {
return out, false, nil
}
// skip entries not containing our suffix
if mgr.suffix != "" {
if !strings.HasSuffix(rr.Name, mgr.suffix) {
return out, false, nil
}
}
err := addr.UnmarshalText([]byte(rr.Value))
if err != nil {
// invalid address on A or AAAA record