* Re: IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network
@ 2021-11-05 15:35 Denis Kenzior
0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2021-11-05 15:35 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
Hi Salahaldeen,
On 11/5/21 10:14 AM, salahaldeen.altous(a)leica-camera.com wrote:
> Hi,
> I have a stand alone device (without internet access) using iwd in Access point mode but some android phones connected to this device show no internet connection and switch back to WiFi home network.
Interesting. Not sure why they would do that if the user explicitly selected to
connect to your device...
> With different dhcp-server (dnsmasq) this problem have been solved by droping defaultroute in answered DHCP requests. How I can solve no internet connection with iwd and the built-in DHCP server.
I suppose we could use the same approach. Could you try the attached patch and
see if this helps.
Regards,
-Denis
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-dhcp-server-Omit-OPTION_ROUTER-if-not-configured.patch --]
[-- Type: text/x-patch, Size: 1010 bytes --]
From 2f114b84d3e990f2d1164cd2259556bbbcd0c2ec Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Fri, 5 Nov 2021 10:28:32 -0500
Subject: [PATCH] dhcp-server: Omit OPTION_ROUTER if not configured
Instead of assuming that OPTION_ROUTER should always be sent, and
setting it to the dhcp server's IP address, omit it entirely if the
gateway was not provided (i.e. l_dhcp_server_set_gateway was not
called.)
---
ell/dhcp-server.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/ell/dhcp-server.c b/ell/dhcp-server.c
index 9c0628a6c30e..c8b06a6ef409 100644
--- a/ell/dhcp-server.c
+++ b/ell/dhcp-server.c
@@ -1032,10 +1032,6 @@ LIB_EXPORT bool l_dhcp_server_start(struct l_dhcp_server *server)
server->address = ia.s_addr;
}
- /* Assign a default gateway if not already set */
- if (!server->gateway)
- server->gateway = server->address;
-
/* Assign a default netmask if not already */
if (!server->netmask) {
if (inet_pton(AF_INET,"255.255.255.0", &ia) != 1)
--
2.26.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network
@ 2021-11-07 9:32 salahaldeen.altous
0 siblings, 0 replies; 5+ messages in thread
From: salahaldeen.altous @ 2021-11-07 9:32 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
Hi Denis,
thanks again for your quick help.
> Hi Salahaldeen,
>
>
> So looking at ell/dhcp-server.c, we shouldn't be sending DNS server info unless
> l_dhcp_server_set_dns has been called. So this part seems OK.
Thanks for your confirmation.
>
> In iwd, src/ap.c... We do not call l_dhcp_server_set_dns unless the profile
> specifies it. So if IPv4.DNSList isn't set, we should not be sending this
> option in the lease.
>
> Can you look (or share) pcaps of iwd & dnsmasq DHCP exchanges to see / compare
> what is actually happening?
The dnsmasq DHCP solution was running at different hardware which is using openwrt.
I will try to run iwd with dnsmasq and dropping DHCP option 3 and 6 and check if it work.
After that I can compare between both DHCP.
>
> Regards,
> -Denis
Regards,
Salahaldeen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network
@ 2021-11-05 18:17 Denis Kenzior
0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2021-11-05 18:17 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 754 bytes --]
Hi Salahaldeen,
> I have tested the attached patch but still not working. I have checked again. We have dropped DHCP option 6 to report Domain Name servers
> +dhcp-option=option:dns-server
> +dhcp-option=option:router
>
> How I can also drop dhcp option 6 to report Domain Name servers?
So looking at ell/dhcp-server.c, we shouldn't be sending DNS server info unless
l_dhcp_server_set_dns has been called. So this part seems OK.
In iwd, src/ap.c... We do not call l_dhcp_server_set_dns unless the profile
specifies it. So if IPv4.DNSList isn't set, we should not be sending this
option in the lease.
Can you look (or share) pcaps of iwd & dnsmasq DHCP exchanges to see / compare
what is actually happening?
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network
@ 2021-11-05 17:47 salahaldeen.altous
0 siblings, 0 replies; 5+ messages in thread
From: salahaldeen.altous @ 2021-11-05 17:47 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
Hi Denis,
> Hi Salahaldeen,
>
> On 11/5/21 10:14 AM, salahaldeen.altous(a)leica-camera.com wrote:
>
> Interesting. Not sure why they would do that if the user explicitly selected to
> connect to your device...
not all Android phones are doing that. But many of them.
>
>
> I suppose we could use the same approach. Could you try the attached patch and
> see if this helps.
I have tested the attached patch but still not working. I have checked again. We have dropped DHCP option 6 to report Domain Name servers
+dhcp-option=option:dns-server
+dhcp-option=option:router
How I can also drop dhcp option 6 to report Domain Name servers?
>
> Regards,
> -Denis
Regards,
Salahaldeen
^ permalink raw reply [flat|nested] 5+ messages in thread
* IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network
@ 2021-11-05 15:14 salahaldeen.altous
0 siblings, 0 replies; 5+ messages in thread
From: salahaldeen.altous @ 2021-11-05 15:14 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
Hi,
I have a stand alone device (without internet access) using iwd in Access point mode but some android phones connected to this device show no internet connection and switch back to WiFi home network.
With different dhcp-server (dnsmasq) this problem have been solved by droping defaultroute in answered DHCP requests. How I can solve no internet connection with iwd and the built-in DHCP server.
Regards,
Salahaldeen Altous
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-07 9:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-05 15:35 IWD is running as AP with the build-in DHCP but android phones report no internet connection and switch back to WiFi home network Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2021-11-07 9:32 salahaldeen.altous
2021-11-05 18:17 Denis Kenzior
2021-11-05 17:47 salahaldeen.altous
2021-11-05 15:14 salahaldeen.altous
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox