Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Another roaming problem
Date: Fri, 09 Mar 2018 15:32:20 +0100	[thread overview]
Message-ID: <87tvtpjp57.fsf@toke.dk> (raw)
In-Reply-To: <87efktzhmj.fsf@toke.dk>

Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk> writes:

> "Jason A. Donenfeld" <Jason@zx2c4.com> writes:
>
>> On Thu, Mar 8, 2018 at 6:50 PM, Toke H=C3=B8iland-J=C3=B8rgensen <toke@t=
oke.dk> wrote:
>>> Well, I do generally setup routing in a somewhat unusual manner.
>>>
>>> I can try to capture some packet dumps tomorrow to poke into it a bit m=
ore. Anything in particular I should look for?
>>
>> One thing to examine is when WireGuard calls
>> `socket_clear_peer_endpoint_src'. This makes wireguard forget the
>> source address that it should be using and fall back to the default.
>> You could add a pr_info(...) call in this function. I have an inkling
>> that I make calls to this function too zealously and in potentially
>> unneeded places, such as on handshake transmission retries.
>>
>> I'm headed out of town super soon, so likely debugging this will have
>> to wait until I'm back, but do let me know what you find, and we'll
>> get this fixed up upon return.
>
> Well, completely failed to reproduce it; everything works as its
> supposed to now (wireguard correctly picks the public IP as its source
> address when replying to the client).
>
> Not sure if I have changed something in my setup or what is going on;
> but at least I can roam now, so I'm happy ;)

Scratch that, it's still happening; just not straight away upon roaming.
It is definitely a timeout thing; installed a kprobe on the function you
mentioned and got this strack trace when it switches IP:

TIME(s)            FUNCTION
104.999884129      socket_clear_peer_endpoint_src
	socket_clear_peer_endpoint_src
	expired_new_handshake
	call_timer_fn
	run_timer_softirq
	__do_softirq
	irq_exit
	smp_apic_timer_interrupt
	__irqentry_text_start
	cpuidle_enter_state
	do_idle
	cpu_startup_entry
	start_secondary
	secondary_startup_64


Think it may be related to powersave on the phone or something? Doesn't
seem to happen with my laptop at least...

-Toke

  reply	other threads:[~2018-03-09 14:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 14:29 Toke Høiland-Jørgensen
2018-03-08 14:49 ` Matthias Urlichs
2018-03-08 16:18 ` Jason A. Donenfeld
2018-03-08 16:59   ` Toke Høiland-Jørgensen
2018-03-08 17:02     ` Jason A. Donenfeld
2018-03-08 17:23       ` Toke Høiland-Jørgensen
2018-03-08 17:39         ` Jason A. Donenfeld
2018-03-08 17:50           ` Toke Høiland-Jørgensen
2018-03-08 18:03             ` Jason A. Donenfeld
2018-03-09 10:08               ` Toke Høiland-Jørgensen
2018-03-09 14:32                 ` Toke Høiland-Jørgensen [this message]
2018-03-09 14:35                   ` Jason A. Donenfeld
2018-03-09 14:42                     ` Toke Høiland-Jørgensen
2018-03-09 14:39                   ` Toke Høiland-Jørgensen
2018-03-09 14:41                     ` Jason A. Donenfeld
2018-03-09 14:46                       ` Toke Høiland-Jørgensen
2018-03-09 14:48                         ` Jason A. Donenfeld
2018-03-09 14:53                           ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvtpjp57.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).