new: gateway.change event for MITM monitoring

This commit is contained in:
Simone Margaritelli 2021-04-10 22:59:03 +02:00
parent 43a93fd866
commit c47e3f6195
8 changed files with 144 additions and 5 deletions

View file

@ -255,8 +255,12 @@ func (s *Session) Start() error {
s.Events.Log(level, "%s", err.Error())
}
// we are the gateway
if s.Gateway == nil || s.Gateway.IpAddress == s.Interface.IpAddress {
s.Gateway = s.Interface
} else {
// start monitoring for gateway changes
go s.routeMon()
}
s.Firewall = firewall.Make(s.Interface)