[management] bring back client version check on login filter hash (#6552)

This commit is contained in:
Pascal Fischer
2026-06-26 16:36:50 +02:00
committed by GitHub
parent ff2787e184
commit f4daf59bcd
@@ -11,9 +11,9 @@ import (
const ( const (
reconnThreshold = 5 * time.Minute reconnThreshold = 5 * time.Minute
baseBlockDuration = 30 * time.Minute // Duration for which a peer is banned after exceeding the reconnection limit baseBlockDuration = 10 * time.Minute // Duration for which a peer is banned after exceeding the reconnection limit
reconnLimitForBan = 30 // Number of reconnections within the reconnTreshold that triggers a ban reconnLimitForBan = 30 // Number of reconnections within the reconnTreshold that triggers a ban
metaChangeLimit = 3 // Number of reconnections with different metadata that triggers a ban of one peer metaChangeLimit = 5 // Number of reconnections with different metadata that triggers a ban of one peer
) )
type lfConfig struct { type lfConfig struct {
@@ -142,6 +142,7 @@ func (l *loginFilter) addLogin(wgPubKey string, metaHash uint64) {
func metaHash(meta nbpeer.PeerSystemMeta) uint64 { func metaHash(meta nbpeer.PeerSystemMeta) uint64 {
h := fnv.New64a() h := fnv.New64a()
h.Write([]byte(meta.WtVersion))
h.Write([]byte(meta.OSVersion)) h.Write([]byte(meta.OSVersion))
h.Write([]byte(meta.KernelVersion)) h.Write([]byte(meta.KernelVersion))
h.Write([]byte(meta.Hostname)) h.Write([]byte(meta.Hostname))