rfc1036 / udptunnel

Tunnel UDP packets in a TCP connection
GNU General Public License v2.0
182 stars 45 forks source link

setup_udp_recv: bind: Address in use #12

Open o-alquimista opened 8 months ago

o-alquimista commented 8 months ago
# udptunnel -v -s 4096 127.0.0.1:55820
Listening for TCP connections on port 4096
setup_udp_recv: bind: Address in use

But netstat doesn't show any instance of port 4096. I'm not using it for anything.

So I tried many different ports, but still udptunnel thinks they're all in use.

Any idea?

OpenWrt 23.05.2 (ramips/mt7621 architecture) udptunnel 1.1-1 installed with opkg.

o-alquimista commented 8 months ago

Side note: the options parser is also misbehaving.

If I input

udptunnel -v -s 0.0.0.0:4096 127.0.0.1:55820

it outputs:

0.0.0.0:4096: invalid port number

It only seems to work with the port number alone (udptunnel -v -s 4096 127.0.0.1:55820)


UPDATE: Actually, it's documented in the usage and I didn't see it.

Usage: udptunnel -s TCP-port [-r] [-v] UDP-addr/UDP-port[/ttl]
    or udptunnel -c TCP-addr[/TCP-port] [-r] [-v] UDP-addr/UDP-port[/ttl]
     -s: Server mode.  Wait for TCP connections on the port.
     -c: Client mode.  Connect to the given address.
     -r: RTP mode.  Connect/listen on ports N and N+1 for both UDP and TCP.
         Port numbers must be even.
     -v: Verbose mode.  Specify -v multiple times for increased verbosity.

Strange, because on Linux it isn't like this. Or maybe the package version I have is older. I need to check that.

On Linux I compile from source. On OpenWrt I install the precompiled binary.

o-alquimista commented 8 months ago

I figured out that the "port in use" refers to port 55820, the port I use for Wireguard traffic. Of course it's being used! I think this is a bug.

This is the same issue reported in https://github.com/rfc1036/udptunnel/issues/9 and https://github.com/rfc1036/udptunnel/issues/8