@@ -215,6 +215,9 @@ struct SSConfig {
215215 #[ serde( skip_serializing_if = "Option::is_none" ) ]
216216 outbound_bind_interface : Option < String > ,
217217
218+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
219+ outbound_udp_allow_fragmentation : Option < bool > ,
220+
218221 #[ serde( skip_serializing_if = "Option::is_none" ) ]
219222 security : Option < SSSecurityConfig > ,
220223
@@ -401,6 +404,9 @@ struct SSServerExtConfig {
401404
402405 #[ serde( skip_serializing_if = "Option::is_none" ) ]
403406 outbound_bind_interface : Option < String > ,
407+
408+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
409+ outbound_udp_allow_fragmentation : Option < bool > ,
404410}
405411
406412#[ cfg( feature = "local-online-config" ) ]
@@ -1240,6 +1246,7 @@ pub struct ServerInstanceConfig {
12401246 pub outbound_fwmark : Option < u32 > ,
12411247 pub outbound_bind_addr : Option < IpAddr > ,
12421248 pub outbound_bind_interface : Option < String > ,
1249+ pub outbound_udp_allow_fragmentation : Option < bool > ,
12431250}
12441251
12451252impl ServerInstanceConfig {
@@ -1252,6 +1259,7 @@ impl ServerInstanceConfig {
12521259 outbound_fwmark : None ,
12531260 outbound_bind_addr : None ,
12541261 outbound_bind_interface : None ,
1262+ outbound_udp_allow_fragmentation : None ,
12551263 }
12561264 }
12571265}
@@ -1336,6 +1344,8 @@ pub struct Config {
13361344 pub outbound_bind_interface : Option < String > ,
13371345 /// Outbound sockets will `bind` to this address
13381346 pub outbound_bind_addr : Option < IpAddr > ,
1347+ /// Outbound UDP sockets allow IP fragmentation
1348+ pub outbound_udp_allow_fragmentation : bool ,
13391349 /// Path to protect callback unix address, only for Android
13401350 #[ cfg( target_os = "android" ) ]
13411351 pub outbound_vpn_protect_path : Option < PathBuf > ,
@@ -1480,6 +1490,7 @@ impl Config {
14801490 outbound_user_cookie : None ,
14811491 outbound_bind_interface : None ,
14821492 outbound_bind_addr : None ,
1493+ outbound_udp_allow_fragmentation : false ,
14831494 #[ cfg( target_os = "android" ) ]
14841495 outbound_vpn_protect_path : None ,
14851496
@@ -1999,6 +2010,7 @@ impl Config {
19992010 outbound_fwmark : config. outbound_fwmark ,
20002011 outbound_bind_addr,
20012012 outbound_bind_interface : config. outbound_bind_interface . clone ( ) ,
2013+ outbound_udp_allow_fragmentation : config. outbound_udp_allow_fragmentation ,
20022014 } ;
20032015
20042016 nconfig. server . push ( server_instance) ;
@@ -2192,6 +2204,7 @@ impl Config {
21922204 outbound_fwmark : config. outbound_fwmark ,
21932205 outbound_bind_addr,
21942206 outbound_bind_interface : config. outbound_bind_interface . clone ( ) ,
2207+ outbound_udp_allow_fragmentation : config. outbound_udp_allow_fragmentation ,
21952208 } ;
21962209
21972210 if let Some ( acl_path) = svr. acl {
@@ -2222,6 +2235,10 @@ impl Config {
22222235 server_instance. outbound_bind_interface = Some ( outbound_bind_interface. clone ( ) ) ;
22232236 }
22242237
2238+ if let Some ( outbound_udp_allow_fragmentation) = svr. outbound_udp_allow_fragmentation {
2239+ server_instance. outbound_udp_allow_fragmentation = Some ( outbound_udp_allow_fragmentation) ;
2240+ }
2241+
22252242 nconfig. server . push ( server_instance) ;
22262243 }
22272244 }
@@ -2387,6 +2404,10 @@ impl Config {
23872404 // Bind device / interface
23882405 nconfig. outbound_bind_interface = config. outbound_bind_interface ;
23892406
2407+ if let Some ( b) = config. outbound_udp_allow_fragmentation {
2408+ nconfig. outbound_udp_allow_fragmentation = b;
2409+ }
2410+
23902411 // Security
23912412 if let Some ( sec) = config. security {
23922413 if let Some ( replay_attack) = sec. replay_attack {
@@ -3045,6 +3066,7 @@ impl fmt::Display for Config {
30453066 outbound_fwmark : inst. outbound_fwmark ,
30463067 outbound_bind_addr : inst. outbound_bind_addr ,
30473068 outbound_bind_interface : inst. outbound_bind_interface . clone ( ) ,
3069+ outbound_udp_allow_fragmentation : inst. outbound_udp_allow_fragmentation ,
30483070 } ) ;
30493071 }
30503072
@@ -3149,6 +3171,7 @@ impl fmt::Display for Config {
31493171
31503172 jconf. outbound_bind_addr = self . outbound_bind_addr . map ( |i| i. to_string ( ) ) ;
31513173 jconf. outbound_bind_interface . clone_from ( & self . outbound_bind_interface ) ;
3174+ jconf. outbound_udp_allow_fragmentation = Some ( self . outbound_udp_allow_fragmentation ) ;
31523175
31533176 // Security
31543177 if self . security . replay_attack . policy != ReplayAttackPolicy :: default ( ) {
0 commit comments