From 07836fc16257b4fe86f4db6dde817be48fe47396 Mon Sep 17 00:00:00 2001 From: TenderIronh Date: Fri, 15 May 2026 17:53:49 +0800 Subject: [PATCH] 3.25.11 --- Changelog.md | 11 ++++++++++- core/common.go | 2 +- core/config.go | 14 +++++++++----- core/handlepush.go | 9 +++++++-- core/openp2p.go | 8 ++++++++ core/p2pnetwork.go | 8 ++++++-- core/protocol.go | 11 ++++++++++- 7 files changed, 51 insertions(+), 12 deletions(-) diff --git a/Changelog.md b/Changelog.md index 410f6ba..e562e2a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,10 +1,19 @@ ChangeLog +v3.25.11更新 (2026.5.15) +Feature +1. + +Issue +1. 修复编辑组网成员网络资源时某些情况网络不通 +1. 修复安卓版本输错token登录崩溃,下次重启自动登录仍会崩溃,不断循环 +1. 修复某些情况导致客户端异常重启 + v3.25.8更新 (2026.3.13) Feature 1. web控制台可以修改公网监听端口 1. 可以修改虚拟网络网段 -1. 回滚至go1.20因为需要支持老版本的macos和windows +1. 回滚至go1.20支持老版本的macos和windows Issue 1. 修复客户端重装后强制v6连接失效bug diff --git a/core/common.go b/core/common.go index 518150d..c081d35 100644 --- a/core/common.go +++ b/core/common.go @@ -144,7 +144,7 @@ func netInfo() *NetInfo { } rsp := NetInfo{} if err = json.Unmarshal(buf[:n], &rsp); err != nil { - gLog.e("wrong NetInfo:%s", err) + gLog.d("wrong NetInfo:%s", err) continue } return &rsp diff --git a/core/config.go b/core/config.go index ae2ef58..2860dd2 100644 --- a/core/config.go +++ b/core/config.go @@ -119,6 +119,10 @@ func (c *Config) resetSDWAN() { func (c *Config) setSDWAN(s SDWANInfo) { c.sdwanMtx.Lock() defer c.sdwanMtx.Unlock() + allNew := false + if c.sdwan.GetResourceByNodeName(c.Network.Node) != s.GetResourceByNodeName(c.Network.Node) { + allNew = true + } // get old-new c.delNodes = []*SDWANNode{} for _, oldNode := range c.sdwan.Nodes { @@ -129,7 +133,7 @@ func (c *Config) setSDWAN(s SDWANInfo) { break } } - if isDeleted { + if isDeleted || allNew { c.delNodes = append(c.delNodes, oldNode) } } @@ -143,7 +147,7 @@ func (c *Config) setSDWAN(s SDWANInfo) { break } } - if isNew { + if isNew || allNew { c.addNodes = append(c.addNodes, newNode) } } @@ -151,9 +155,9 @@ func (c *Config) setSDWAN(s SDWANInfo) { if c.sdwan.TunnelNum < 2 { c.sdwan.TunnelNum = 2 // DEBUG } - if c.sdwan.TunnelNum > 3 { - c.sdwan.TunnelNum = 3 - } + // if c.sdwan.TunnelNum > 3 { + // c.sdwan.TunnelNum = 3 + // } } func (c *Config) switchApp(app AppConfig, enabled int) { diff --git a/core/handlepush.go b/core/handlepush.go index 7e5bf6f..bdae587 100644 --- a/core/handlepush.go +++ b/core/handlepush.go @@ -147,12 +147,17 @@ func handlePush(subType uint16, msg []byte) error { gLog.i("MsgPushUpdate") err := update(gConf.Network.ServerHost, gConf.Network.ServerPort) if err == nil { - os.Exit(9) // 9 tell daemon this exit because of update + if !isAndroid() { + os.Exit(9) // 9 tell daemon this exit because of update + } + } return err case MsgPushRestart: gLog.i("MsgPushRestart") - os.Exit(0) + if !isAndroid() { + os.Exit(0) + } return err case MsgPushReportApps: err = handleReportApps() diff --git a/core/openp2p.go b/core/openp2p.go index abd913d..cb09eda 100644 --- a/core/openp2p.go +++ b/core/openp2p.go @@ -135,6 +135,14 @@ func GetToken(baseDir string) string { return fmt.Sprintf("%d", gConf.Network.Token) } +func SetToken(token string) { + n, err := strconv.ParseUint(token, 10, 64) + if err == nil && n > 0 { + gConf.setToken(n) + gConf.save() + } +} + func Stop() { os.Exit(0) } diff --git a/core/p2pnetwork.go b/core/p2pnetwork.go index df39f8c..7abc4eb 100644 --- a/core/p2pnetwork.go +++ b/core/p2pnetwork.go @@ -153,7 +153,9 @@ func (pn *P2PNetwork) keepAlive() { } gLog.e("P2PNetwork keepAlive error, exit worker") dumpStack() - os.Exit(9) + if !isAndroid() { + os.Exit(9) + } } } } @@ -811,7 +813,9 @@ func (pn *P2PNetwork) init() error { head, _ := pn.read("", MsgReport, MsgReportBasicRsp, ClientAPITimeout) if head == nil { gLog.e("read MsgReportBasic rsp error again, exit") - os.Exit(9) + if !isAndroid() { + os.Exit(9) + } } return } diff --git a/core/protocol.go b/core/protocol.go index 34d0ba5..fea56d1 100644 --- a/core/protocol.go +++ b/core/protocol.go @@ -10,7 +10,7 @@ import ( "time" ) -const OpenP2PVersion = "3.25.8" +const OpenP2PVersion = "3.25.11" const ProductName string = "openp2p" const LeastSupportVersion = "3.0.0" const SyncServerTimeVersion = "3.9.0" @@ -547,6 +547,15 @@ type SDWANInfo struct { Nodes []*SDWANNode } +func (s *SDWANInfo) GetResourceByNodeName(nodeName string) string { + for _, node := range s.Nodes { + if node.Name == nodeName { + return node.Resource + } + } + return "" +} + const ( SDWANModeFullmesh = "fullmesh" SDWANModeCentral = "central"