Browse Source

#18 Gw from cfg

master
Kirill Nikolaev 10 months ago
parent
commit
751e20932a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      analyze.go

+ 2
- 2
analyze.go View File

@@ -8,7 +8,6 @@ import (
"strings"
)

var HM_IP = "127.0.0.1"
var connections = map[string]int{}
var Duration int
var PackageNumber int
@@ -88,7 +87,8 @@ func Analyze(b *bytes.Reader, fromPeer string, toPeer string, isSecured bool) bo
p := packet.(*SubscribePacket)
for _, v := range p.Topics {
if isMatched("config$", v.Name) {
if !(strings.Split(fromPeer, ":")[0] == HM_IP) {
if !(strings.Split(fromPeer, ":")[0] ==
config.Filter.ScanProtection.HomeAssistantGwIp) {
return false
}
}


Loading…
Cancel
Save