Skip to content

Commit

Permalink
Revert "Always open tunnels with ifidx zero"
Browse files Browse the repository at this point in the history
This reverts commit 46caffb.
  • Loading branch information
jkilpatr committed Aug 2, 2023
1 parent 59313dd commit ff3e6f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rita_common/src/tunnel_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,12 @@ impl TunnelManager {
peer.ifidx,
);

let (new_key, tunnel) =
create_new_tunnel(peer.contact_socket.ip(), our_port, their_localid)?;
let (new_key, tunnel) = create_new_tunnel(
peer.contact_socket.ip(),
our_port,
peer.ifidx,
their_localid,
)?;

self.tunnels
.entry(new_key)
Expand All @@ -535,10 +539,11 @@ impl TunnelManager {
fn create_new_tunnel(
peer_ip: IpAddr,
our_port: u16,
ifidx: u32,
their_localid: LocalIdentity,
) -> Result<(Identity, Tunnel), RitaCommonError> {
// Create new tunnel
let tunnel = Tunnel::new(peer_ip, our_port, 0, their_localid);
let tunnel = Tunnel::new(peer_ip, our_port, ifidx, their_localid);
let tunnel = match tunnel {
Ok(tunnel) => {
trace!("Tunnel {:?} is open", tunnel);
Expand Down

0 comments on commit ff3e6f8

Please sign in to comment.