fix: RESTful api missing TunConf.device

In commit 54fee7b, due to failure to take into account that
not all required parameters of `sing_tun.server.New` have
default values provided by `LC.Tun`, the name of the tun device
cannot be obtained when `TunConf.device` is not explicitly
configured. This commit fixed the issue.
This commit is contained in:
YanceyChiew authored and Larvan2 committed 2023-09-02 14:12:53 +08:00
1 parent a366e9a4b5
commit 9feb4d6668
2 files changed
+2 -4

No files matched your search

+1 -1
View File
@@ -134,7 +134,7 @@ func GetGeneral() *config.General {
RedirPort: ports.RedirPort,
TProxyPort: ports.TProxyPort,
MixedPort: ports.MixedPort,
Tun: listener.LastTunConf,
Tun: listener.GetTunConf(),
TuicServer: listener.GetTuicConf(),
ShadowSocksConfig: ports.ShadowSocksConfig,
VmessConfig: ports.VmessConfig,
+1 -3
View File
@@ -84,9 +84,7 @@ type Ports struct {
func GetTunConf() LC.Tun {
if tunLister == nil {
return LC.Tun{
Enable: false,
}
return LastTunConf
}
return tunLister.Config()
}