Skip to content

Commit

Permalink
Fix wrong condition on interface check
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxneric authored Nov 29, 2024
1 parent c21c623 commit 6614de4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions monitor_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package tun
import (
"sync"

"github.com/sagernet/sing-tun/internal/winipcfg"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/logger"
"github.com/sagernet/sing/common/x/list"

"github.com/sagernet/sing-tun/internal/winipcfg"

"golang.org/x/sys/windows"
)

Expand Down Expand Up @@ -108,7 +109,7 @@ func (m *defaultInterfaceMonitor) checkUpdate() error {
return E.Cause(err, "find updated interface: ", alias)
}
m.defaultInterface.Store(newInterface)
if oldInterface != nil && !oldInterface.Equals(*newInterface) {
if oldInterface != nil && oldInterface.Equals(*newInterface) {
return nil
}
m.emit(newInterface, 0)
Expand Down

0 comments on commit 6614de4

Please sign in to comment.