wifi scan failing on ubuntu
by Klaus Anderson
hi all,
I'm playing with connman on my Ubuntu 17.04 laptop and got Ethernet going
ok, but only get "no carrier" error when trying to do a wifi scan. Could
someone please point me towards the right direction or give some hints on
how to debug this further.
Here's some details from my command line:
klasu@klasu-ThinkPad-T470p:~[0 0 0]$ connmand --version
1.33
klasu@klasu-ThinkPad-T470p:~[0]$ sudo connmanctl scan wifi
Error /net/connman/technology/wifi: No carrier
klasu@klasu-ThinkPad-T470p:~[0 0 0]$ sudo connmanctl technologies
/net/connman/technology/ethernet
Name = Wired
Type = ethernet
Powered = True
Connected = True
Tethering = False
/net/connman/technology/wifi
Name = WiFi
Type = wifi
Powered = True
Connected = False
Tethering = False
/net/connman/technology/bluetooth
Name = Bluetooth
Type = bluetooth
Powered = True
Connected = False
Tethering = False
klasu@klasu-ThinkPad-T470p:~[0]$ sudo rfkill list
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
9: phy1: Wireless LAN
Soft blocked: no
Hard blocked: no
10: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
klasu@klasu-ThinkPad-T470p:~[0]$ sudo iw wlan0 scan |grep BSS|grep wlan0
BSS 4c:e6:76:22:aa:35(on wlan0)
BSS 68:7f:74:15:8f:aa(on wlan0)
cheers, klaus
4 years, 4 months
BUG: file descriptor leak in DHCPv6
by Richard Genoud
Hi all,
I found a bug in connman, leading to a "too many open files" error.
( version used : 1.35 )
Here are the steps to reproduce.
On a shell, do :
while [ true ]; do ls -l /proc/$(pidof connmand)/fd/ | wc -l ; sleep 1; done
This will monitor the number of opened files/sockets of connmand.
Start connman with nothing else that ethernet connection (DHCP
client), on a network with a DHCPv4 server (this is important)
Then, plug / unplug several times the ethernet cable (every 2 seconds,
ten times should suffice)
The number of opened file descriptors should increase and increase.
The things I know :
- I can NOT reproduce it if there's no DHCPv4 server on the subnet and
connman is configured as DHCP client
- I can reproduce it configuring connman with a static IPv4
- If I add IPv6=off in the wired service, there's no more fd leak.
Trying to debug that, I found that it seems to be the file descriptor :
dhcp_client->listener_sockfd related to DHCPv6
that is not closed when the ethernet link goes down.
regards,
Richard.
4 years, 5 months
[PATCH 0/4] d-bus reply to "scan p2p" is not send if wifi/p2p scanning interleave in some unlucky way
by Vasyl Vavrychuk
* On connman start there is wifi scan started https://gitlab.com/snippets/1690556#L472.
* Then suppose we call "scan p2p" from connmanctl.
* Suppose `scan_callback` from wifi scan is received sooner than `p2p_find_stop` called.
This callback will put device scanning property to 0. https://gitlab.com/snippets/1690556#L896
* Then after p2p_find_stop callback https://gitlab.com/snippets/1690556#L978
call to `connman_device_set_scanning` will not send reply_scan_pending for p2p technology because scanning property was already set to 0.
On connmanctl side error is
Error /net/connman/technology/p2p: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
This is happening because we can start/stop scanning for device in per-service-type manner but this is not taken into account in `connman_device_set_scanning` code chunk
if (device->scanning == scanning)
return -EALREADY;
Vasyl Vavrychuk (4):
device: disable scanning with unknown service type
p2p: fix no d-bus reply for 'scan p2p' due to conflict with wifi scan
technology: checking for device service type became redundant
wifi: use better criteria if we are P2P scanning in places where
possible
include/device.h | 3 ++-
plugins/wifi.c | 14 +++++++-------
src/device.c | 27 +++++++++++++++++++++------
src/service.c | 3 ++-
src/technology.c | 5 +----
5 files changed, 33 insertions(+), 19 deletions(-)
--
2.11.0
4 years, 5 months
[PATCH] gresolv: ignore valid dns response with no answer
by Eliott Dumeix
A dns response may return NOERROR status code with no answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3924
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
It means one or more resource records exist for this domain but
there isn’t a record matching the resource record type.
In this case, a G_RESOLV_RESULT_STATUS_SUCCESS was returned with an
empty results array.
---
gweb/gresolv.c | 7 +++++--
gweb/gresolv.h | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 8a51a9f6..35d518ca 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -511,7 +511,7 @@ static void sort_and_return_results(struct resolv_lookup *lookup)
status = lookup->ipv4_status;
}
- debug(lookup->resolv, "lookup %p received %d results", lookup, n);
+ debug(lookup->resolv, "lookup %p received %d results", lookup, n-1);
g_queue_remove(lookup->resolv->lookup_queue, lookup);
destroy_lookup(lookup);
@@ -679,7 +679,10 @@ static void parse_response(struct resolv_nameserver *nameserver,
switch (rcode) {
case ns_r_noerror:
- status = G_RESOLV_RESULT_STATUS_SUCCESS;
+ if (count > 0)
+ status = G_RESOLV_RESULT_STATUS_SUCCESS;
+ else
+ status = G_RESOLV_RESULT_STATUS_NO_ANSWER;
break;
case ns_r_formerr:
status = G_RESOLV_RESULT_STATUS_FORMAT_ERROR;
diff --git a/gweb/gresolv.h b/gweb/gresolv.h
index fac14f54..23c2a9bf 100644
--- a/gweb/gresolv.h
+++ b/gweb/gresolv.h
@@ -44,6 +44,11 @@ typedef enum {
G_RESOLV_RESULT_STATUS_NAME_ERROR,
G_RESOLV_RESULT_STATUS_NOT_IMPLEMENTED,
G_RESOLV_RESULT_STATUS_REFUSED,
+ /*
+ * It means one or more resource records exist for this domain but there
+ * isn’t a record matching the resource record type.
+ */
+ G_RESOLV_RESULT_STATUS_NO_ANSWER,
} GResolvResultStatus;
typedef void (*GResolvResultFunc)(GResolvResultStatus status,
--
2.13.6
4 years, 5 months
[PATCH 1/2] Install DBus policy in /usr/share/dbus-1/system.d
by Jonas Bonn
The default location for DBus policy files should be
/usr/share/dbus-1/system.d and the corresponding directory under /etc
should be reserved for administrative changes to default/packaged
settings. This removes a dependency of connman on a populated /etc.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4feccc08..3cdf4b29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,9 +230,9 @@ AC_SUBST(DBUS_LIBS)
AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
[path to D-Bus config directory]), [path_dbusconf=${withval}],
- [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
+ [path_dbusconf="`$PKG_CONFIG --variable=datadir dbus-1`"])
if (test -z "${path_dbusconf}"); then
- DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
+ DBUS_CONFDIR="${datadir}/dbus-1/system.d"
else
DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
fi
--
2.14.1
4 years, 5 months
How can one specify what wired and wireless interfaces to use?
by KARBOWSKI Piotr
Hello,
I'd like to ask, how can one specify what interfaces should be used?
I see that I can start `connmand` with `-i` and `-I` switches and I
could use that to omit devices, but that's a bit problematic.
If I have two wireless cards, wlan0 and wlan1, how can I choose which to
use to connect? I'd like to connect with wlan0 to one network and with
wlan1 to another.
-- Piotr.
4 years, 5 months
[PATCH v2 0/3] add option to enable auto connection for roaming
by Christophe Ronco
Hi,
I need to auto-connect cellular services even if they are roaming.
So I added an option in main.conf to enable that (or not).
I don't know if this can be useful for other Connman users.
Best Regards,
Christophe Ronco
Christophe Ronco (3):
main: add option to enable auto connection for roaming services
service: implement option to enable auto connection for roaming
services
main.conf: document option to enable auto connection for roaming
services
doc/connman.conf.5.in | 5 +++++
src/main.c | 14 ++++++++++++++
src/main.conf | 5 +++++
3 files changed, 24 insertions(+)
--
2.7.4
4 years, 5 months
Re: wifi scan failing on ubuntu
by Vasyl Vavrychuk
Hi,
Could you please make sure that network manager is not running: systemctl
status NetworkManager
I had maybe similar problem to your. To debug it I wanted to build
wpa_supplicant by myself with some prints but I found issue disappeared
after that. You can try it by yourself
apt install build-essential devscripts ccache
apt build-dep wpa_supplicant
cd wpa
debuild -b -us -uc
dpkg -i ../package.deb
Kind regards,
Vasyl
4 years, 6 months
connman crashes when turn off Wi-Fi during P2P connection establishing
by Vasyl Vavrychuk
g_str_hash (v=0x0) at
/usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/ghash.c:1876
1876 for (p = v; *p != '\0'; p++)
(gdb) bt
#0 g_str_hash (v=0x0) at
/usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/ghash.c:1876
#1 0xb6f026a0 in g_hash_table_lookup_node (hash_return=<synthetic
pointer>, key=0x0, hash_table=0xe0288) at
/usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/ghash.c:375
#2 g_hash_table_lookup_extended (hash_table=0xe0288, lookup_key=0x0,
orig_key=orig_key@entry=0x0, value=0xe2680, value@entry=0x0) at
/usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/ghash.c:1184
#3 0x0008e378 in allow_property_changed (peer=0xe3fe0) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/peer.c:275
#4 state_changed (peer=0xe3fe0) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/peer.c:429
#5 connman_peer_set_state (peer=peer@entry=0xe3fe0,
new_state=new_state@entry=CONNMAN_PEER_STATE_DISCONNECT) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/peer.c:930
#6 0x0008e7c4 in peer_disconnect (peer=peer@entry=0xe3fe0) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/peer.c:633
#7 0x0008e85c in report_error_cb (user_context=0xe3fe0, retry=<optimized
out>, user_data=<optimized out>) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/peer.c:852
#8 0x00060ea8 in report_error_reply (reply=0x1015c8, user_data=0xd12c8) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/agent.c:369
#9 0x00060fc4 in agent_finalize_pending (reply=reply@entry=0x1015c8,
agent=<optimized out>) at
/usr/src/debug/connman/1.35-r1/connman-1.35/src/agent.c:121
#10 0x00061120 in agent_receive_message (call=0xfb9e0, user_data=0xfc4f0)
at /usr/src/debug/connman/1.35-r1/connman-1.35/src/agent.c:208
#11 0xb6e8d8bc in ?? () from /usr/lib/libdbus-1.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
4 years, 6 months
[PATCH] Wait 4 seconds for RA before re-sending RS messages.
by Niraj Kumar Goit
As per RFC 4861, a host should transmit up to 3 Router Solicitation
messages, each separated by at least RTR_SOLICITATION_INTERVAL(4)
seconds to obtain RA for IPv6 auto-configuration.
---
src/network.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/network.c b/src/network.c
index ed56210..f3e422f 100644
--- a/src/network.c
+++ b/src/network.c
@@ -41,6 +41,13 @@
*/
#define RS_REFRESH_TIMEOUT 3
+/*
+ * As per RFC 4861, a host should transmit up to MAX_RTR_SOLICITATIONS(3)
+ * Router Solicitation messages, each separated by at least
+ * RTR_SOLICITATION_INTERVAL(4) seconds to obtain RA for IPv6 auto-configuration.
+ */
+#define RTR_SOLICITATION_INTERVAL 4
+
static GSList *network_list = NULL;
static GSList *driver_list = NULL;
@@ -427,7 +434,7 @@ static void check_dhcpv6(struct nd_router_advert *reply,
DBG("re-send router solicitation %d",
network->router_solicit_count);
network->router_solicit_count--;
- __connman_inet_ipv6_send_rs(network->index, 1,
+ __connman_inet_ipv6_send_rs(network->index, RTR_SOLICITATION_INTERVAL,
check_dhcpv6, network);
return;
}
@@ -577,7 +584,8 @@ static void autoconf_ipv6_set(struct connman_network *network)
/* Try to get stateless DHCPv6 information, RFC 3736 */
network->router_solicit_count = 3;
- __connman_inet_ipv6_send_rs(index, 1, check_dhcpv6, network);
+ __connman_inet_ipv6_send_rs(index, RTR_SOLICITATION_INTERVAL,
+ check_dhcpv6, network);
}
static void set_connected(struct connman_network *network)
--
1.9.1
4 years, 6 months