dns/sync: remove redundant suffix check

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-10-24 15:14:50 +00:00
parent 134606207d
commit b6750f8b28
+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