connman built with `--disable-ethernet` wipe ethernet interface configuration on start anyway
by KARBOWSKI Piotr
Hi,
I have connman built with `--disable-ethernet`. However, every time I
start connmand, the configuration of eth0 interface is wiped.
Is there a way to make connman not touch my wired interfaces? I tried to
set 'Enabled' option in /var/lib/connman/settings to both true and false
in the '[Wired]' part, but nothing changed, connman keeps wiping my
runtime configuration.
-- Piotr.
2 years, 11 months
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
2 years, 11 months
[PATCH 0/3] Fixes and extensions for WPS support
by Robert Tiemann
Allow clients to identify WPS registrars.
Note that I am actually not quite happy with patch 3 because I have
copied some parts from network_added() to network_changed() in
plugins/wifi.c. Maybe it would be good to refactor it later to avoid
code duplication.
Robert Tiemann (3):
service: Indicate which wifi network has WPS activated.
gsupplicant: Fix WPS capabilities updates.
gsupplicant: Report changes of network WPS capabilities.
gsupplicant/supplicant.c | 22 +++++++++++++++++++++-
plugins/wifi.c | 37 ++++++++++++++++++++++++++++++++++---
src/network.c | 5 +++++
src/service.c | 16 ++++++++++++++--
4 files changed, 74 insertions(+), 6 deletions(-)
--
1.9.1
2 years, 11 months
[PATCH] iptables: Fix iptables protocol usage with -p switch.
by Jussi Laakkonen
This commit fixes protocol use with iptables management. Protocol type is
changed to uint16_t, which is the type xtables_parse_protocol() returns.
Without this fix iptables rules with switch -p cannot be added to iptables and
setsockopt() in iptables_replace() will return error: Invalid argument.
---
src/iptables.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/iptables.c b/src/iptables.c
index fd692e9..1101e5c 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1563,6 +1563,7 @@ static struct option iptables_opts[] = {
{.name = "out-interface", .has_arg = 1, .val = 'o'},
{.name = "source", .has_arg = 1, .val = 's'},
{.name = "table", .has_arg = 1, .val = 't'},
+ {.name = "protocol", .has_arg = 1, .val = 'p'},
{NULL},
};
@@ -1772,7 +1773,7 @@ struct parse_context {
struct xtables_target *xt_t;
GList *xt_m;
struct xtables_rule_match *xt_rm;
- int proto;
+ uint16_t proto;
};
static int prepare_getopt_args(const char *str, struct parse_context *ctx)
@@ -1962,7 +1963,7 @@ static int parse_rule_spec(struct connman_iptables *table,
optind = 0;
while ((c = getopt_long(ctx->argc, ctx->argv,
- "-:d:i:o:s:m:j:",
+ "-:d:i:o:s:m:j:p:",
iptables_globals.opts, NULL)) != -1) {
switch (c) {
case 's':
@@ -2026,6 +2027,12 @@ static int parse_rule_spec(struct connman_iptables *table,
break;
case 'p':
ctx->proto = xtables_parse_protocol(optarg);
+
+ /* If protocol was set add it to ipt_ip.
+ * xtables_parse_protocol() returns 0 or UINT16_MAX (-1) on error
+ * */
+ if (ctx->proto > 0 && ctx->proto < UINT16_MAX)
+ ctx->ip->proto = ctx->proto;
break;
case 'j':
/* Target */
--
2.7.4
2 years, 11 months
[PATCH] iptables: allow netmask 32 in parse_ip_and_mask()
by Jussi Laakkonen
Netmask 32 should not be treated as invalid value.
---
src/iptables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/iptables.c b/src/iptables.c
index 1101e5c..23ef889 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1726,7 +1726,7 @@ static int parse_ip_and_mask(const char *str, struct in_addr *ip,
if (tokens[1]) {
prefixlength = strtol(tokens[1], NULL, 10);
- if (prefixlength > 31) {
+ if (prefixlength > 32) {
err = -1;
goto out;
}
--
2.7.4
2 years, 11 months
[PATCH] iptables: Add duplicate chain check to iptables_add_chain().
by Jussi Laakkonen
This commit adds a check to iptables_add_chain() before new chain is added. If
a chain with same name is found -EEXIST will be returned.
Without this, e.g., chain INPUT can be duplicated to iptables filter table and
it cannot be removed with iptables_remove_chain() or iptables -X. After boot
the duplicate builtin chain is removed.
---
src/iptables.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/iptables.c b/src/iptables.c
index 5ef757a..fd692e9 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -598,6 +598,10 @@ static int iptables_add_chain(struct connman_iptables *table,
DBG("table %s chain %s", table->name, name);
+ /* Do not allow to add duplicate chains */
+ if (find_chain_head(table, name))
+ return -EEXIST;
+
last = g_list_last(table->entries);
/*
--
2.7.4
2 years, 11 months
[PATCH v2 0/3] Fixes and extensions for WPS support
by Robert Tiemann
Allow clients to identify WPS registrars.
Note that I am actually not quite happy with patch 3 because I have
copied some parts from network_added() to network_changed() in
plugins/wifi.c. Maybe it would be good to refactor it later to avoid
code duplication.
v2:
- Improve commit message.
- Fix warnings reported by checkpatch.pl.
Robert Tiemann (3):
service: Indicate which wifi network has WPS activated.
gsupplicant: Fix WPS capabilities updates.
gsupplicant: Report changes of network WPS capabilities.
gsupplicant/supplicant.c | 22 +++++++++++++++++++++-
plugins/wifi.c | 40 ++++++++++++++++++++++++++++++++++++----
src/network.c | 5 +++++
src/service.c | 18 ++++++++++++++++--
4 files changed, 78 insertions(+), 7 deletions(-)
--
1.9.1
3 years
[PATCH v1 0/5] Retry NTP servers periodically on startup
by Daniel Wagner
Hi,
This is the attempt to fix the outstanding CM-636 bug. This is still
not completely finished. There is some more potential to cleanup the
timeserver code. But I thought maybe someone wants to test it. You can
install a iptables rule to see if the retry logic works.
iptables -A OUTPUT -p tcp --dport 123 -j DROP
iptables -A OUTPUT -p udp --dport 123 -j DROP
This should do the trick.
Thanks,
Daniel
Daniel Wagner (5):
ntp: Move variables into data struct
ntp: Add callback to __connman_ntp_start()
timeserver: Rename __connman_timeserver_sync_next() to sync_next()
timeserver: Retry NTP servers periodically on startup
ntp: Report EPERM to timeserver
src/connman.h | 5 +-
src/ntp.c | 218 +++++++++++++++++++++++++++++--------------------------
src/timeserver.c | 103 ++++++++++++++++++++++----
3 files changed, 205 insertions(+), 121 deletions(-)
--
2.14.3
3 years
[PATCH] tethering: Reorder header includes
by Daniel Wagner
Avoid compile errors due to unsupported header include order with
newer kernels (>=4.15). We should import the libc header files first
and then the Linux header files in user space applications.
Reported by Neil MacLeod <neil(a)nmacleod.com>. Fix probosal by Jonas
Bonn <jonas(a)southpole.se> and Hauke Mehrtens <hauke(a)hauke-m.de>.
---
src/tethering.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/tethering.c b/src/tethering.c
index c929ba71a6dd..4b202369106f 100644
--- a/src/tethering.c
+++ b/src/tethering.c
@@ -31,11 +31,11 @@
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
-#include <linux/sockios.h>
#include <string.h>
#include <fcntl.h>
-#include <linux/if_tun.h>
#include <netinet/in.h>
+#include <linux/sockios.h>
+#include <linux/if_tun.h>
#include <linux/if_bridge.h>
#include "connman.h"
--
2.14.3
3 years