update tm bundle fetch, fix desktop joiners
This commit is contained in:
1 parent
6afdbd901a
commit
c62aa89d4c
8 files changed
+50
-5
No files matched your search
@@ -168,6 +168,10 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
|
||||
}
|
||||
addr := v4.String()
|
||||
t.mu.Lock()
|
||||
if t.stopped {
|
||||
t.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
if _, dup := t.bypass[addr]; dup {
|
||||
t.mu.Unlock()
|
||||
return nil
|
||||
@@ -182,6 +186,13 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
|
||||
return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err)
|
||||
}
|
||||
t.mu.Lock()
|
||||
if t.stopped {
|
||||
t.mu.Unlock()
|
||||
if _, err := runCmd("ip", "route", "del", addr+"/32"); err != nil {
|
||||
t.log("[desktoptun] remove orphaned bypass %s: %v", addr, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
t.bypass[addr] = struct{}{}
|
||||
t.mu.Unlock()
|
||||
t.log("[desktoptun] bypass %s -> %s", addr, gw)
|
||||
|
||||
Reference in new issue
Block a user