mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-06 00:56:39 +00:00
Use builtin clear instead of maps.Clear
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
|||||||
"github.com/google/gopacket/layers"
|
"github.com/google/gopacket/layers"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
|
|
||||||
firewall "github.com/netbirdio/netbird/client/firewall/manager"
|
firewall "github.com/netbirdio/netbird/client/firewall/manager"
|
||||||
"github.com/netbirdio/netbird/client/firewall/uspfilter/common"
|
"github.com/netbirdio/netbird/client/firewall/uspfilter/common"
|
||||||
@@ -612,10 +611,10 @@ func (m *Manager) Flush() error { return nil }
|
|||||||
// resetState clears all firewall rules and closes connection trackers.
|
// resetState clears all firewall rules and closes connection trackers.
|
||||||
// Must be called with m.mutex held.
|
// Must be called with m.mutex held.
|
||||||
func (m *Manager) resetState() {
|
func (m *Manager) resetState() {
|
||||||
maps.Clear(m.outgoingRules)
|
clear(m.outgoingRules)
|
||||||
maps.Clear(m.incomingDenyRules)
|
clear(m.incomingDenyRules)
|
||||||
maps.Clear(m.incomingRules)
|
clear(m.incomingRules)
|
||||||
maps.Clear(m.routeRulesMap)
|
clear(m.routeRulesMap)
|
||||||
m.routeRules = m.routeRules[:0]
|
m.routeRules = m.routeRules[:0]
|
||||||
m.udpHookOut.Store(nil)
|
m.udpHookOut.Store(nil)
|
||||||
m.tcpHookOut.Store(nil)
|
m.tcpHookOut.Store(nil)
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ func (s *DefaultServer) Stop() {
|
|||||||
log.Errorf("failed to disable DNS: %v", err)
|
log.Errorf("failed to disable DNS: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
maps.Clear(s.extraDomains)
|
clear(s.extraDomains)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefaultServer) disableDNS() (retErr error) {
|
func (s *DefaultServer) disableDNS() (retErr error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user