Re: [PATCH] gweb: Do not lookup for a NULL key in a hash table
by Måns Rullgård
Tomasz Bursztyka <tomasz.bursztyka(a)linux.intel.com> writes:
> At this position, no key might have been provided yet.
>
> Reported by Marcel Mulder <mmulder(a)victronenergy.com>
> ---
>
> Hi Marcel,
>
> Does that helps?
>
> Btw the logs you provided are missing the gweb parts.
> Could you run connman like: CONNMAN_WEB_DEBUG=1 connmnand <your options>
Did this ever get fixed properly?
> gweb/gweb.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/gweb/gweb.c b/gweb/gweb.c
> index f6828cf..7771190 100644
> --- a/gweb/gweb.c
> +++ b/gweb/gweb.c
> @@ -806,6 +806,9 @@ static void handle_multi_line(struct web_session *session)
> g_string_insert_c(session->current_header, 0, ' ');
> }
>
> + if (!session->result.last_key)
> + return;
> +
> value = g_hash_table_lookup(session->result.headers,
> session->result.last_key);
> if (value) {
> --
> 1.8.3.2
--
Måns Rullgård
4 years, 3 months
[PATCH] gweb: fix crash on malformed http response
by Mans Rullgard
If an http response has a line starting with whitespace before the first
valid header field, g_hash_table_lookup() is called with a null key,
which is invalid. Fix this by checking for a valid last_key before
attempting to process continuation lines.
---
gweb/gweb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gweb/gweb.c b/gweb/gweb.c
index 6ce5028ad57c..10e8c8fe0b8d 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -792,6 +792,9 @@ static void handle_multi_line(struct web_session *session)
char *str;
gchar *value;
+ if (!session->result.last_key)
+ return;
+
str = session->current_header->str;
if (str[0] != ' ' && str[0] != '\t')
--
2.10.0
4 years, 3 months
FW: [PATCH] dhcp: Follow the RFC regarding ordrer of "subnet" and "router" option
by Kristian Klausen
Resending because it seems like I need to be subscribed, before I can post.
and it impossible to get in contact with any Connman dev (which could check the mail, and allow it to be posted).. At least on #connman on freenode.
----------------------------------------
> From: klausenbusk(a)hotmail.com
> To: connman(a)lists.01.org
> Subject: [PATCH] dhcp: Follow the RFC regarding ordrer of "subnet" and "router" option
> Date: Wed, 28 Sep 2016 22:17:30 +0200
>
> The 2132 RFC clearly state, that the "subnet" option should be before
> the "router" option.
>
> "If both the subnet mask and the router option are specified in a DHCP
> reply, the subnet mask option MUST be first."
> - https://tools.ietf.org/html/rfc2132#section-3.3
>
> Some dhcp servers (D-Link DSR-1000) doesn't responds correctly, if that
> isn't the case.
> For example the D-Link DSR-1000 which respond back with a DHCPACK
> containing two "subnet" option but no "router" option.
> ---
> src/dhcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/dhcp.c b/src/dhcp.c
> index 57e7ac9..4d23581 100644
> --- a/src/dhcp.c
> +++ b/src/dhcp.c
> @@ -576,8 +576,8 @@ static int dhcp_initialize(struct connman_dhcp *dhcp)
> g_dhcp_client_set_request(dhcp_client, G_DHCP_MTU);
> }
>
> - g_dhcp_client_set_request(dhcp_client, G_DHCP_SUBNET);
> g_dhcp_client_set_request(dhcp_client, G_DHCP_ROUTER);
> + g_dhcp_client_set_request(dhcp_client, G_DHCP_SUBNET);
>
> g_dhcp_client_register_event(dhcp_client,
> G_DHCP_CLIENT_EVENT_LEASE_AVAILABLE,
> --
> 2.10.0
>
>
4 years, 3 months
[PATCH 1/3] docs: update manager-api.txt to include BrowserOnly Key
by Atul Anand
It has been documented that we are adding a new dict key BrowserOnly
on PACrunner DBus interface.
---
doc/manager-api.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/doc/manager-api.txt b/doc/manager-api.txt
index 9e6209d..0e0b7aa 100644
--- a/doc/manager-api.txt
+++ b/doc/manager-api.txt
@@ -60,6 +60,12 @@ Methods object CreateProxyConfiguration(dict settings)
Interface name like "wlan0" etc. to provide
consistent results for myIpAddress function.
+ boolean BrowserOnly [optional]
+
+ If this value is set, proxy configuration will
+ be used for only browser schemes. If no Key is
+ received PACrunner assumes FALSE by default.
+
array{string} Domains [optional]
Domain names and IP range for which this proxy
--
2.5.5
4 years, 3 months
[PATCH 0/1] Fix nameserver and search domain ordering when writing resolv.conf
by Sam Nazarko
Hi,
This patch fixes an issue where DNS servers and search domains are written to
resolv.conf in the reverse order. This has caused problems with some OSMC users that
have relied on the primary DNS server to be listed first and have a faulty or intermittent
secondary DNS server. While I am in agreement that these users should fix their secondary
DNS server, we should still respect the ordering that they configure or get via DHCP.
I previously submitted a patch to this mailing list in hope of addressing an issue
however the ConnMan mailing list disappeared for a while and I lost my post. This
new patch resolves both search domains and DNS servers being out of order.
Sam Nazarko
4 years, 3 months
[PATCH 00/16] Coverity warnings and cleanup
by Peter Meerwald-Stadler
patches 1 to 6 address issues flagged by Coverity
patch 7 removes necessary code and an invalid comment
patches 8 and 9 are cleanup
patch 10 addresses a Coverity issue
patch 11 removes unused code
patches 12 to 16 unifies get_random() code and moves it into shared/
Peter Meerwald-Stadler (16):
dhcpv6: Check setsockopt() retval
common: Check setsockopt() retval
ntp: Fix unused value
gdhcp: Fix potential NULL deref
ofono: Fix potential NULL deref
peer_service: Setting retval ignored, always overwritten
dhcpv6: Remove pointless compute_random() helper
build: Fix whitespace Makefile.am
util: Make file handle of /dev/urandom static
util: Reading from /dev/urandom ignores the number of bytes read
shared: Drop unused shared/debugfs.c|.h
shared: Add util_get_random()
gdhcp: Use util_get_random()
gdhcp: Remove dhcp_get_random()
Use util_get_random()
Remove __connman_util_get_random()
Makefile.am | 8 ++---
gdhcp/client.c | 10 +++---
gdhcp/common.c | 53 ++++++++-----------------------
gdhcp/common.h | 1 +
gdhcp/gdhcp.h | 3 --
gdhcp/ipv4ll.c | 7 ++---
plugins/ofono.c | 3 +-
src/config.c | 4 ++-
src/connman.h | 3 --
src/dhcp.c | 2 --
src/dhcpv6.c | 20 +++++-------
src/dnsproxy.c | 4 +--
src/main.c | 4 +--
src/ntp.c | 3 +-
src/peer_service.c | 3 --
src/shared/debugfs.c | 66 ---------------------------------------
src/shared/debugfs.h | 24 --------------
src/shared/util.c | 45 +++++++++++++++++++++++++++
src/shared/util.h | 5 +++
src/util.c | 88 ----------------------------------------------------
20 files changed, 95 insertions(+), 261 deletions(-)
delete mode 100644 src/shared/debugfs.c
delete mode 100644 src/shared/debugfs.h
delete mode 100644 src/util.c
--
2.7.4
4 years, 3 months
[PATCH] service: Use PreferredTechnologies for service ordering
by Maxime Chevallier
When services have the same state, the PreferredTechnologies list needs
to be taken into account for service ordering. This applies when all
services are 'ready' but none is 'online'.
This patch checks for services in PreferredTechnologies before
defaulting to the hardcoded list in service_compare.
---
src/service.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/service.c b/src/service.c
index 37af5fc..ee10e6c 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4759,6 +4759,20 @@ static gint service_compare(gconstpointer a, gconstpointer b)
return 1;
if (service_a->type != service_b->type) {
+ unsigned int *tech_array;
+ int i;
+
+ tech_array = connman_setting_get_uint_list(
+ "PreferredTechnologies");
+ if (tech_array) {
+ for (i = 0; tech_array[i]; i++) {
+ if (tech_array[i] == service_a->type)
+ return -1;
+
+ if (tech_array[i] == service_b->type)
+ return 1;
+ }
+ }
if (service_a->type == CONNMAN_SERVICE_TYPE_ETHERNET)
return -1;
--
2.1.4
4 years, 3 months
[PATCH v0 0/3] nftable session fixes
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
The first patch removes the connection tracking code from ConnMan. We
never really used it. It looks like we are soon having means to
enforce network activies via cgroups (eBPF) thanks to Daniel Macks
work [1]. So I think its better to have this kind of enforcement in an
external component.
The second patch does add a warning when nftables fails. It took me a
while to figure out what's going on when I forgot to load the right
module. So why not just be userfriendly.
The last patch moves the marking rule to the route table. I just
placed it iniatially into the filter chain. That was wrong. With this,
the packets are routed acording the session settings.
cheers,
daniel
[1] https://lwn.net/Articles/701162/
Daniel Wagner (3):
nftables: Drop connection tracking
nftables: Improve warning messages
nftables: Mark packets in the route table
src/firewall-nftables.c | 119 ++++++------------------------------------------
1 file changed, 14 insertions(+), 105 deletions(-)
--
2.7.4
4 years, 3 months
[PATCH v0 0/2] OpenVPN logging
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
I am debugging some network setups here and found out that we don't
log anything from OpenVPN which is pretty sad. Let's fix this.
cheers,
daniel
Daniel Wagner (2):
openvpn: Fix stdout/stderr forwarding from deamon
openvpn: Add verbose flag
vpn/plugins/openvpn.c | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 5 deletions(-)
--
2.5.5
4 years, 3 months
[PATCH] technology: avoid redundant saving to the file system
by Yusuke Nakamura
Even if OfflineMode is the same as before, Connman always saves
to the file system. This patch makes Connman to save OfflineMode
only when it is actually changed in order to avoid redundant data
writing.
---
src/technology.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/technology.c b/src/technology.c
index 660af52..0fc2cb2 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -444,15 +444,31 @@ bool __connman_technology_get_offlinemode(void)
static void connman_technology_save_offlinemode(void)
{
GKeyFile *keyfile;
+ GError *error = NULL;
+ bool offlinemode;
keyfile = __connman_storage_load_global();
- if (!keyfile)
+
+ if (!keyfile) {
keyfile = g_key_file_new();
+ g_key_file_set_boolean(keyfile, "global",
+ "OfflineMode", global_offlinemode);
- g_key_file_set_boolean(keyfile, "global",
+ __connman_storage_save_global(keyfile);
+ }
+ else {
+ offlinemode = g_key_file_get_boolean(keyfile, "global",
+ "OfflineMode", &error);
+
+ if (error || offlinemode != global_offlinemode) {
+ g_key_file_set_boolean(keyfile, "global",
"OfflineMode", global_offlinemode);
+ if (error)
+ g_clear_error(&error);
- __connman_storage_save_global(keyfile);
+ __connman_storage_save_global(keyfile);
+ }
+ }
g_key_file_free(keyfile);
--
1.7.9.5
4 years, 3 months