Skip to content

Commit

Permalink
don't allow making tunnels to initiator
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptix committed May 10, 2021
1 parent ae1fd47 commit 2e5af65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion muxrpc/handlers/tunnel/server/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ func (h connectHandler) HandleDuplex(ctx context.Context, req *muxrpc.Request, p
return err
}

// see if we have and endpoint for the target
// make sure they dont want to connect to themselves
if caller.Equal(&arg.Target) {
return fmt.Errorf("can't connect to self")
}

// see if we have and endpoint for the target
edp, has := h.state.Has(arg.Target)
if !has {
return fmt.Errorf("could not connect to:%s", arg.Target.Ref())
Expand Down

0 comments on commit 2e5af65

Please sign in to comment.