Fix monitor

This commit is contained in:
世界 2024-11-12 10:43:04 +08:00
parent d105263fed
commit 6a7c4036d3
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 13 additions and 9 deletions

View file

@ -107,11 +107,10 @@ func (m *networkUpdateMonitor) Close() error {
}
func (m *defaultInterfaceMonitor) checkUpdate() error {
err := m.interfaceFinder.Update()
if err != nil {
return E.Cause(err, "update interfaces")
}
var defaultInterface *control.Interface
var (
defaultInterface *control.Interface
err error
)
if m.underNetworkExtension {
defaultInterface, err = m.getDefaultInterfaceBySocket()
if err != nil {