File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use crate::{
66 } ,
77 session:: { Network , Session , Type } ,
88} ;
9+ use crate :: common:: errors:: new_io_error;
910
1011use async_trait:: async_trait;
1112use std:: { io, net:: SocketAddr , os:: fd:: AsRawFd , sync:: Arc } ;
@@ -72,7 +73,7 @@ impl InboundHandlerTrait for RedirInbound {
7273
7374 let sess = Session {
7475 network : Network :: Tcp ,
75- typ : Type :: Tproxy ,
76+ typ : Type :: Redir ,
7677 source : src_addr,
7778 destination : orig_dst. into ( ) ,
7879 so_mark : self . fw_mark ,
@@ -89,7 +90,7 @@ impl InboundHandlerTrait for RedirInbound {
8990 }
9091
9192 async fn listen_udp ( & self ) -> std:: io:: Result < ( ) > {
92- panic ! ( "redir doesn't support udp" )
93+ Err ( new_io_error ( "unsupported UDP protocol for Redir inbound" ) )
9394 }
9495}
9596
Original file line number Diff line number Diff line change @@ -401,6 +401,8 @@ pub enum Type {
401401 Tun ,
402402 #[ cfg( all( target_os = "linux" , feature = "tproxy" ) ) ]
403403 Tproxy ,
404+ #[ cfg( all( target_os = "linux" , feature = "redir" ) ) ]
405+ Redir ,
404406 Tunnel ,
405407 Shadowsocks ,
406408 Ignore ,
You can’t perform that action at this time.
0 commit comments