File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
crates/shadowsocks-service/src/local/tun Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,13 @@ impl TunBuilder {
108
108
pub async fn build ( mut self ) -> io:: Result < Tun > {
109
109
self . tun_config . layer ( Layer :: L3 ) . up ( ) ;
110
110
111
- #[ cfg( target_os = "linux" ) ]
112
- self . tun_config . platform_config ( |tun_config| {
113
- // IFF_NO_PI preventing excessive buffer reallocating
114
- tun_config. packet_information ( false ) ;
115
- } ) ;
111
+ // XXX: tun2 set IFF_NO_PI by default.
112
+ //
113
+ // #[cfg(target_os = "linux")]
114
+ // self.tun_config.platform_config(|tun_config| {
115
+ // // IFF_NO_PI preventing excessive buffer reallocating
116
+ // tun_config.packet_information(false);
117
+ // });
116
118
117
119
let device = match create_as_async ( & self . tun_config ) {
118
120
Ok ( d) => d,
@@ -203,9 +205,10 @@ impl Tun {
203
205
) ;
204
206
205
207
// Set default route
206
- if let Err ( err) = sys:: set_route_configuration ( self . device . as_mut ( ) ) . await {
207
- warn ! ( "[TUN] tun device set route failed, error: {}" , err) ;
208
- }
208
+ // XXX: tun2 already set it by default.
209
+ // if let Err(err) = sys::set_route_configuration(self.device.as_mut()).await {
210
+ // warn!("[TUN] tun device set route failed, error: {}", err);
211
+ // }
209
212
210
213
let address_broadcast = address_net. broadcast ( ) ;
211
214
You can’t perform that action at this time.
0 commit comments