mirror of
https://github.com/safing/portmaster
synced 2025-09-07 13:09:17 +00:00
Update Ipv6 connections on setting change
This commit is contained in:
parent
b6e0894257
commit
ead271f51c
1 changed files with 21 additions and 9 deletions
|
@ -120,17 +120,29 @@ func ClearCache() error {
|
||||||
|
|
||||||
// Updates a specific connection verdict.
|
// Updates a specific connection verdict.
|
||||||
func UpdateVerdict(conn *network.Connection) error {
|
func UpdateVerdict(conn *network.Connection) error {
|
||||||
|
if conn.IPVersion == 4 {
|
||||||
|
update := kext_interface.UpdateV4{
|
||||||
|
Protocol: conn.Entity.Protocol,
|
||||||
|
LocalAddress: [4]byte(conn.LocalIP),
|
||||||
|
LocalPort: conn.LocalPort,
|
||||||
|
RemoteAddress: [4]byte(conn.Entity.IP),
|
||||||
|
RemotePort: conn.Entity.Port,
|
||||||
|
Verdict: uint8(conn.Verdict.Active),
|
||||||
|
}
|
||||||
|
|
||||||
update := kext_interface.UpdateV4{
|
return kext_interface.SendUpdateV4Command(kextFile, update)
|
||||||
Protocol: conn.Entity.Protocol,
|
} else if conn.IPVersion == 6 {
|
||||||
LocalAddress: [4]byte(conn.LocalIP),
|
update := kext_interface.UpdateV6{
|
||||||
LocalPort: conn.LocalPort,
|
Protocol: conn.Entity.Protocol,
|
||||||
RemoteAddress: [4]byte(conn.Entity.IP),
|
LocalAddress: [16]byte(conn.LocalIP),
|
||||||
RemotePort: conn.Entity.Port,
|
LocalPort: conn.LocalPort,
|
||||||
Verdict: uint8(conn.Verdict.Active),
|
RemoteAddress: [16]byte(conn.Entity.IP),
|
||||||
|
RemotePort: conn.Entity.Port,
|
||||||
|
Verdict: uint8(conn.Verdict.Active),
|
||||||
|
}
|
||||||
|
|
||||||
|
return kext_interface.SendUpdateV6Command(kextFile, update)
|
||||||
}
|
}
|
||||||
|
|
||||||
kext_interface.SendUpdateV4Command(kextFile, update)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue