Skip to content

Wait forever to exit #215

@ethever

Description

@ethever

When you start tun2proxy without a global IP address and then press Ctrl-C to stop it, the process hangs indefinitely.

...
[2025-07-15T01:34:01Z INFO  tun2proxy] Beginning #198 TCP 10.0.0.33:35434 -> 192.168.31.21:10808
[2025-07-15T01:34:01Z DEBUG ipstack::stream::tcp] TCP 10.0.0.33:35460 -> 192.168.31.21:10808 Listen: local { seq: 1607316745, ack: 3127895765 } session begins, total TCP sessions: 200
[2025-07-15T01:34:01Z DEBUG ipstack] session created: TCP 10.0.0.33:35460 -> 192.168.31.21:10808
[2025-07-15T01:34:01Z WARN  tun2proxy] Too many sessions that over 200, dropping new session
[2025-07-15T01:34:01Z INFO  tun2proxy] Beginning #199 TCP 10.0.0.33:35450 -> 192.168.31.21:10808
[2025-07-15T01:34:01Z DEBUG ipstack::stream::tcp] TCP 10.0.0.33:35460 -> 192.168.31.21:10808 task exited due to exit signal
[2025-07-15T01:34:01Z DEBUG ipstack] session destroyed: TCP 10.0.0.33:35460 -> 192.168.31.21:10808
[2025-07-15T01:34:01Z DEBUG ipstack::stream::tcp] TCP 10.0.0.33:35460 -> 192.168.31.21:10808 SynReceived: [drop] session dropped, total TCP sessions: 199


^C[2025-07-15T01:34:25Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
[2025-07-15T01:34:25Z INFO  tun2proxy_bin] Ctrl-C received, exiting...
[2025-07-15T01:34:25Z INFO  tun2proxy] Shutdown received
[2025-07-15T01:34:25Z DEBUG tproxy_config::linux] removing route: RouteMessage { header: RouteHeader { address_family: Inet, destination_prefix_length: 1, source_prefix_length: 0, tos: 0, table: 254, protocol: Static, scope: Universe, kind: Unicast, flags: RouteFlags(0x0) }, attributes: [Destination(Inet(0.0.0.0)), Oif(112)] }
[2025-07-15T01:34:25Z DEBUG tproxy_config::linux] removing route: RouteMessage { header: RouteHeader { address_family: Inet, destination_prefix_length: 1, source_prefix_length: 0, tos: 0, table: 254, protocol: Static, scope: Universe, kind: Unicast, flags: RouteFlags(0x0) }, attributes: [Destination(Inet(128.0.0.0)), Oif(112)] }
[2025-07-15T01:34:25Z DEBUG tproxy_config::linux] deleting link: tun0
[2025-07-15T01:34:25Z DEBUG tproxy_config::linux] unmounting /etc/resolv.conf
[2025-07-15T01:34:25Z DEBUG tproxy_config::common] restoring network settings
[2025-07-15T01:34:25Z INFO  tun2proxy_bin] Ctrl-C fired, waiting the handler to finish...
[2025-07-15T01:34:25Z DEBUG ipstack::stream::tcp] TCP 10.0.0.33:34108 -> 192.168.31.21:10808 Established: [drop] session dropped, total TCP sessions: 198
^[[A

^C[2025-07-15T01:34:28Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe

^C[2025-07-15T01:34:30Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:30Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:40Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:40Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:40Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:40Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:40Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:41Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:41Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:41Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:42Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:42Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:42Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe
^C[2025-07-15T01:34:43Z DEBUG ctrlc2::platform::unix] Ctrl-C event received, writing to pipe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions