Fix interface callback

This commit is contained in:
世界 2024-11-12 23:18:20 +08:00
parent 64c0f526fd
commit b4300eaa6a
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 16 additions and 22 deletions

View file

@ -16,6 +16,7 @@ import (
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/bufio"
"github.com/sagernet/sing/common/control"
E "github.com/sagernet/sing/common/exceptions"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing/common/rw"
@ -881,8 +882,8 @@ func (t *NativeTun) resetRules() error {
return t.setRules()
}
func (t *NativeTun) routeUpdate(event int) {
if event&EventAndroidVPNUpdate == 0 {
func (t *NativeTun) routeUpdate(_ *control.Interface, flags int) {
if flags&FlagAndroidVPNUpdate == 0 {
return
}
err := t.resetRules()