File tree 1 file changed +11
-6
lines changed
talpid-wireguard/src/wireguard_go
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,18 @@ impl WgGoTunnel {
106
106
}
107
107
}
108
108
109
- pub fn set_config ( mut self , config : & Config ) -> Result < Self > {
110
- let connectivity_checker = self
111
- . take_checker ( )
112
- . expect ( "connectivity checker unexpectedly dropped" ) ;
109
+ pub fn set_config ( self , config : & Config ) -> Result < Self > {
113
110
let state = self . as_state ( ) ;
114
111
let log_path = state. _logging_context . path . clone ( ) ;
115
112
let tun_provider = Arc :: clone ( & state. tun_provider ) ;
116
113
let routes = config. get_tunnel_destinations ( ) ;
117
114
118
115
match self {
119
- WgGoTunnel :: Multihop ( state) if !config. is_multihop ( ) => {
116
+ WgGoTunnel :: Multihop ( mut state) if !config. is_multihop ( ) => {
117
+ let connectivity_checker = state
118
+ . connectivity_checker
119
+ . take ( )
120
+ . expect ( "connectivity checker unexpectedly dropped" ) ;
120
121
state. stop ( ) ?;
121
122
Self :: start_tunnel (
122
123
config,
@@ -126,7 +127,11 @@ impl WgGoTunnel {
126
127
connectivity_checker,
127
128
)
128
129
}
129
- WgGoTunnel :: Singlehop ( state) if config. is_multihop ( ) => {
130
+ WgGoTunnel :: Singlehop ( mut state) if config. is_multihop ( ) => {
131
+ let connectivity_checker = state
132
+ . connectivity_checker
133
+ . take ( )
134
+ . expect ( "connectivity checker unexpectedly dropped" ) ;
130
135
state. stop ( ) ?;
131
136
Self :: start_multihop_tunnel (
132
137
config,
You can’t perform that action at this time.
0 commit comments