Improve captive portal handling

This commit is contained in:
Daniel
2020-07-15 08:53:55 +02:00
parent ec637bdce8
commit e369a9484a
13 changed files with 323 additions and 31 deletions

View File

@@ -8,6 +8,8 @@ import (
"sync"
"time"
"github.com/safing/portmaster/netenv"
"github.com/safing/portbase/database/record"
"github.com/safing/portbase/log"
"github.com/safing/portmaster/intel"
@@ -148,6 +150,13 @@ func NewConnectionFromFirstPacket(pkt packet.Packet) *Connection {
}
}
// check if destination IP is the captive portal's IP
portal := netenv.GetCaptivePortal()
if portal.IP != nil && pkt.Info().Dst.Equal(portal.IP) {
scope = portal.Domain
entity.Domain = portal.Domain
}
if scope == "" {
// outbound direct (possibly P2P) connection