Development discussion of WireGuard
 help / color / mirror / Atom feed
* WireGuard Android: Cached resolved host
@ 2018-10-23 16:40 Heiko Friedel
  2018-11-04 17:25 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Friedel @ 2018-10-23 16:40 UTC (permalink / raw)
  To: wireguard

Hi all!

I'm using WireGurad on Android to connect to my home server with a 
dynamic IP address. It can change from time to time.

When I need to reconnect due to achanged IP address, it seems that 
WireGurad is using a cached hostname and not re-resolving it. I have to 
"force stop" the app.

Is there a specific reason for caching the hostname?

It would also be great if WireGurad re-resolves the hostname when the 
handshake (keep alive) has timed out.

Thank you,
Heiko








_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: WireGuard Android: Cached resolved host
  2018-10-23 16:40 WireGuard Android: Cached resolved host Heiko Friedel
@ 2018-11-04 17:25 ` Jason A. Donenfeld
  2018-11-05 16:56   ` Heiko Friedel
  0 siblings, 1 reply; 3+ messages in thread
From: Jason A. Donenfeld @ 2018-11-04 17:25 UTC (permalink / raw)
  To: hf; +Cc: WireGuard mailing list

t's mostly this way to prevent DNS lookup failures during the network
connectivity changes, such as turning on and off and on a tunnel
really fast. I agree the current implementation's behavior is
suboptimal though. Probably instead we should invalidate based on the
TTL.

The code in question lives at
app/src/main/java/com/wireguard/config/InetEndpoint.java if you want
to take a stab at fixing it.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: WireGuard Android: Cached resolved host
  2018-11-04 17:25 ` Jason A. Donenfeld
@ 2018-11-05 16:56   ` Heiko Friedel
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Friedel @ 2018-11-05 16:56 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: wireguard

How fast is turning on and off and on?

AddressCache.java already implements a cache with a fixed TTL of 2 seconds.

A quick fix was to re-resolve with every call to getResolvedEndpoint(). 
I'm testing this for a couple of days without issues.

Am 04.11.2018 um 18:25 schrieb Jason A. Donenfeld:

> It's mostly this way to prevent DNS lookup failures during the network
> connectivity changes, such as turning on and off and on a tunnel
> really fast. I agree the current implementation's behavior is
> suboptimal though. Probably instead we should invalidate based on the
> TTL.
> 
> The code in question lives at
> app/src/main/java/com/wireguard/config/InetEndpoint.java if you want
> to take a stab at fixing it.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-06  0:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23 16:40 WireGuard Android: Cached resolved host Heiko Friedel
2018-11-04 17:25 ` Jason A. Donenfeld
2018-11-05 16:56   ` Heiko Friedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).