dhcpcd-discuss

Re: dhcpcd kills all connections on Wi-Fi roaming between access points

Boris Krasnovskiy

Thu Dec 10 18:53:35 2020

Hi Roy,

this patch fixes 20-resolv.conf issues

On Wed, Dec 9, 2020 at 1:32 PM Boris Krasnovskiy <borkra@xxxxxxxxx> wrote:

> Hi Roy,
>
> Thank you, this patch is working.
>
> Although there is one more problem with 20-resolv.conf hook. I had not
> noticed it earlier. Log below:
>
> wlan0: carrier lost
> wlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks NOCARRIER
> cat: can't open '/run/resolvconf/lock/pid': No such file or directory
> wlan0: carrier acquired
> wlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks CARRIER
>
> 1. It seems 20-resolv.conf hook is trying to remove DNS info on roaming,
> this should not happen
> 2. openresolv 3.10 package forgot to create /run/resolvconf/lock directory
> it is using.
>
> The reason I did not handle ROAMING -> DOWN transition, because
> wpa_supplicant did not generate one in all our testing. Although yes, it is
> prudent to handle this scenario as well.
>
> On Wed, Dec 9, 2020 at 8:37 AM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
>> Hi Boris
>>
>> On 08/12/2020 20:21, Boris Krasnovskiy wrote:
>>
>> > thank you for the patch. It does work, in a simplest scenario, like
>> roaming
>> > between 2.4 and 5 GHz on the same router, although it does not for
>> > the enterprise networks.
>> >
>> > There is another function that needs to be there, on the roaming event
>> it is
>> > prudent:
>> >    - abort any in-progress DHCP/RA negotiations
>> >    - force the RENEW request for the IP addresses on reconnect
>> >
>> > The problems are:
>> > - After the roaming client is connected to a different access point,
>> which is a
>> > different network device, with different IP and MAC so routing needs to
>> change
>> > on the infrastructure side. That process takes time and effort,
>> together with
>> > the time client was not accessible during roaming itself. So likely
>> DHCP/RA
>> > messages got lost during disruption. As such it would be much faster
>> not to
>> > wait for the DHCP timeout, but just force restart DHCP/RA negotiation.
>> > - There is a network misconfiguration (in modern days it's extremely
>> rare to see
>> > it), where after roaming you endup on a different subnet of the same
>> network.
>> >
>> > I attached the patch that implements this functionality and according
>> to our
>> > testing works well.
>>
>> I've attached a patch based on yours, which I think is cleaner and more
>> OS agnostic.
>>
>> One issue I spotted with your patch is that it would not drop the lease
>> if it
>> went ROAMING -> DOWN, this one should.
>>
>> I've deliberately ignored one part of your patch for now (btw disabling
>> with #if
>> 0 .... #endif would result in a cleaner diff) as I'm still not convinced
>> it's
>> relevant. If this works, I can commit this and then discuss the other
>> part.
>>
>> Roy
>>
>
>
> --
> Thank you,
> Boris Krasnovskiy
>


-- 
Thank you,
Boris Krasnovskiy
--- a/src/script.c	2020-11-28 09:12:59.000000000
+++ b/src/script.c	2020-12-10 12:45:25.000000000
@@ -404,7 +404,8 @@
 	} else if (strcmp(reason, "TEST") == 0 ||
 	    strcmp(reason, "PREINIT") == 0 ||
 	    strcmp(reason, "CARRIER") == 0 ||
-	    strcmp(reason, "UNKNOWN") == 0)
+	    strcmp(reason, "UNKNOWN") == 0 ||
+	    if_roaming(ifp))
 	{
 		if (efprintf(fp, "if_up=false") == -1)
 			goto eexit;

References:
dhcpcd kills all connections on Wi-Fi roaming between access pointsBoris Krasnovskiy
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsRoy Marples
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsBoris Krasnovskiy
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsRoy Marples
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsBoris Krasnovskiy
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsRoy Marples
Re: dhcpcd kills all connections on Wi-Fi roaming between access pointsBoris Krasnovskiy
Archive administrator: postmaster@marples.name