Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad latest handshake timestamp and keepalives not being sent #388

Closed
foxx opened this issue Jan 21, 2024 · 3 comments
Closed

Bad latest handshake timestamp and keepalives not being sent #388

foxx opened this issue Jan 21, 2024 · 3 comments

Comments

@foxx
Copy link

foxx commented Jan 21, 2024

The interface appears to work fine and traffic flows, but the handshake timestamp is wrong. Any ideas?

  allowed ips: 0.0.0.0/0
  latest handshake: 54 years, 33 days, 10 hours, 32 minutes, 50 seconds ago
  transfer: 1.49 KiB received, 794 B sent
  persistent keepalive: every 30 seconds

Some extra information:

version: boringtun 0.6.0
date on server: Sun 21 Jan 10:35:17 GMT 2024
cmd: /home/admin/.cargo/bin/boringtun-cli -f -t 1 -v info --disable-multi-queue XXXX
persistent-keepalive: 30

Some logs:

   2024-01-21T10:32:49.362627Z  INFO boringtun_cli: BoringTun started successfully
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-cli-0.6.0/src/main.rs:178

   2024-01-21T10:32:49.362625Z ERROR boringtun::device: Poll error, error: "Interrupted system call (os error 4)"
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/device/mod.rs:268

   2024-01-21T10:32:49.386833Z  INFO boringtun::device: Peer added

It also appears that keepalives are not being sent, as the sent bytes counter does not increment every 30 seconds.

   2024-01-21T10:40:00.153605Z DEBUG boringtun::noise: New session, session: 3544592385
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/noise/mod.rs:405

   2024-01-21T10:40:00.153616Z DEBUG boringtun::noise: Sending keepalive
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/noise/mod.rs:370

   2024-01-21T10:40:30.265113Z DEBUG boringtun::noise::timers: KEEPALIVE(PERSISTENT_KEEPALIVE)
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/noise/timers.rs:295

   2024-01-21T10:41:00.265183Z DEBUG boringtun::noise::timers: KEEPALIVE(PERSISTENT_KEEPALIVE)
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/noise/timers.rs:295

   2024-01-21T10:41:30.515177Z DEBUG boringtun::noise::timers: KEEPALIVE(PERSISTENT_KEEPALIVE)
     at /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringtun-0.6.0/src/noise/timers.rs:295
@foxx foxx changed the title Latest handshake timestamp seems incorrect Bad latest handshake timestamp and keepalives not being sent Jan 21, 2024
@CodingMarkus
Copy link

I'm using my own transport code and I do see keep-alives being sent out as expected. Maybe those are no longer counted towards the byte counters? Try tcpdump to verify that really no keep-alive are being sent out.

As for time_since_last_handshake, yes, this property is never updated for me either in the 0.5.2 release, it's always -1. It does get updated correctly in the 0.4.0 release. That's a show stopper as time_since_last_handshake was the only way I could detect a tunnel to be up, as in 0.4.0 it would stay -1 as long as the tunnel is down and become >0 as soon as it was up.

@CodingMarkus
Copy link

Still broken in 0.5.2 but works correctly again in 0.6.0. Unfortunately none of those release are tagged. If you need the source of the 0.6.0 release, see #358

@foxx
Copy link
Author

foxx commented Aug 23, 2024

Awesome, thanks @CodingMarkus. I'm going to close this out in favour of #358 .

@foxx foxx closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants