nicocha30 / ligolo-ng

An advanced, yet simple, tunneling/pivoting tool that uses a TUN interface.
GNU General Public License v3.0
2.61k stars 260 forks source link

Fix listener errors when manually stopping #79

Closed jdholtz closed 2 months ago

jdholtz commented 2 months ago

Fixes #56.

This fixes three errors when using listener_stop <id> in a session:

  1. Stopping a TCP listener without the --no-retry flag continuously prints a message about retrying the listener
  2. Stopping a TCP listener with the --no-retry flag prints an error about EOF and exits (not technically an issue as the message is true, but there's no reason for this message)
  3. A listener the ends without errors (e.g. a UDP listener before this fix) would endlessly print "Listener ended without error."

Because line 102 in pkg/proxy/listeners.go already returns an error, it seems to me that having the err == io.EOF check should return nil, otherwise there is no point in having it (and it fixes 2 of the 3 errors mentioned above).

nicocha30 commented 2 months ago

Thanks @jdholtz !