config/json: fix tun auto for json config (#358)

This commit is contained in:
vincentliu77 authored and GitHub committed 2023-03-18 05:32:31 +08:00
1 parent a70d98db2b
commit aaaddbd204
1 file changed
+4
+4
View File
@@ -64,6 +64,7 @@ pub struct ChainInboundSettings {
#[derive(Serialize, Deserialize, Debug)]
pub struct TunInboundSettings {
pub auto: Option<bool>,
pub fd: Option<i32>,
pub name: Option<String>,
pub address: Option<String>,
@@ -335,6 +336,9 @@ pub fn to_internal(json: &mut Config) -> Result<internal::Config> {
if let Some(ext_netmask) = ext_settings.netmask {
settings.netmask = ext_netmask;
}
if let Some(ext_auto) = ext_settings.auto {
settings.auto = ext_auto;
}
if let Some(ext_mtu) = ext_settings.mtu {
settings.mtu = ext_mtu;
} else {