mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-07 17:29:59 +00:00
Replace maps.Clear with builtin clear; fix appendAssign in test
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
nberrors "github.com/netbirdio/netbird/client/errors"
|
||||
firewall "github.com/netbirdio/netbird/client/firewall/manager"
|
||||
@@ -675,10 +674,10 @@ func (m *Manager) Flush() error { return nil }
|
||||
// resetState clears all firewall rules and closes connection trackers.
|
||||
// Must be called with m.mutex held.
|
||||
func (m *Manager) resetState() {
|
||||
maps.Clear(m.outgoingRules)
|
||||
maps.Clear(m.incomingDenyRules)
|
||||
maps.Clear(m.incomingRules)
|
||||
maps.Clear(m.routeRulesMap)
|
||||
clear(m.outgoingRules)
|
||||
clear(m.incomingDenyRules)
|
||||
clear(m.incomingRules)
|
||||
clear(m.routeRulesMap)
|
||||
m.routeRules = m.routeRules[:0]
|
||||
m.udpHookOut.Store(nil)
|
||||
m.tcpHookOut.Store(nil)
|
||||
|
||||
@@ -67,7 +67,8 @@ func TestParseICMPv6_SingleExtension(t *testing.T) {
|
||||
src := netip.MustParseAddr("fd00::1")
|
||||
dst := netip.MustParseAddr("fd00::2")
|
||||
hbh := extHdr(t, uint8(header.ICMPv6ProtocolNumber), 8)
|
||||
payload := append(hbh, echoRequest()...)
|
||||
payload := append([]byte{}, hbh...)
|
||||
payload = append(payload, echoRequest()...)
|
||||
pkt := makeIPv6(t, src, dst, uint8(header.IPv6HopByHopOptionsExtHdrIdentifier), payload)
|
||||
|
||||
off, icmpLen, _, _, ok := parseICMPv6(pkt)
|
||||
|
||||
@@ -410,7 +410,7 @@ func (s *DefaultServer) Stop() {
|
||||
log.Errorf("failed to disable DNS: %v", err)
|
||||
}
|
||||
|
||||
maps.Clear(s.extraDomains)
|
||||
clear(s.extraDomains)
|
||||
}
|
||||
|
||||
func (s *DefaultServer) disableDNS() (retErr error) {
|
||||
|
||||
Reference in New Issue
Block a user