jpillora / jpillora/chisel

when channel is closed, outbound always by use

Open
#447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
16.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/jpillora/chisel/blob/4eb9e6a87ff57d16c94fe01f98d31d455ab4f759/share/tunnel/tunnel_in_proxy_udp.go#L155

maybe rm outbound when req chan close?
like this

move set outbound nil to func
https://github.com/jpillora/chisel/blob/4eb9e6a87ff57d16c94fe01f98d31d455ab4f759/share/tunnel/tunnel_in_proxy_udp.go#L185

func (u *udpListener) unsetUDPChan(sshConn ssh.Conn) {
	sshConn.Wait()
	u.onLoseChannel()
}

func (u *udpListener) onLoseChannel() {
	u.Debugf("lost channel")
	u.outboundMut.Lock()
	u.outbound = nil
	u.outboundMut.Unlock()
}

call onLoseChannel after chan close https://github.com/jpillora/chisel/blob/4eb9e6a87ff57d16c94fe01f98d31d455ab4f759/share/tunnel/tunnel_in_proxy_udp.go#L171

go func() {
  ssh.DiscardRequests(reqs)
  // channel done...
  u.onLoseChannel()
}()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in share/tunnel/tunnel_in_proxy_udp.go at the linked lines, reading how udpListener handles the request channel and outbound state. Trace the channel-close path and the unsetUDPChan function, then verify that outbound is cleared after the channel is lost and is no longer reused for outbound traffic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.