chore: allow config table-index for tun

https://github.com/MetaCubeX/mihomo/issues/1128
This commit is contained in:
wwqgtxx
2024-03-24 21:31:52 +08:00
parent d2ae94f20b
commit 5af7f4e847
6 changed files with 16 additions and 2 deletions

View File

@@ -91,6 +91,7 @@ type tunSchema struct {
EndpointIndependentNat *bool `yaml:"endpoint-independent-nat" json:"endpoint-independent-nat,omitempty"`
UDPTimeout *int64 `yaml:"udp-timeout" json:"udp-timeout,omitempty"`
FileDescriptor *int `yaml:"file-descriptor" json:"file-descriptor"`
TableIndex *int `yaml:"table-index" json:"table-index"`
}
type tuicServerSchema struct {
@@ -209,6 +210,9 @@ func pointerOrDefaultTun(p *tunSchema, def LC.Tun) LC.Tun {
if p.FileDescriptor != nil {
def.FileDescriptor = *p.FileDescriptor
}
if p.TableIndex != nil {
def.TableIndex = *p.TableIndex
}
}
return def
}