Age | Commit message (Collapse) | Author | Files | Lines |
|
When getting disconnected from the bus sometimes (maybe always?)
dbus_watch_handle() can cause the "info" context to be free'd meaning
that we should not try to access it after the call. The only member we
need access to is the connection pointer and as the code already has a
ref() call for it it's only natural to solve the issue by adding a local
variable not dependent on "info".
The backtrace of the crash fixed looks as follows:
Invalid read of size 8
at 0x121085: watch_func (mainloop.c:105)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
at 0x4A079AE: free (vg_replace_malloc.c:427)
by 0x4C7837E: g_free (gmem.c:252)
by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
by 0x121084: watch_func (mainloop.c:103)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
|
|
|
|
The structure can now be directly freed, since the reference count
is always one. As a result, remove wispr_portal_context_unref()
function.
|
|
Remove reset_service_usage() as it is now obsolete with the
refcount always being equal to one.
|
|
There is no need to refcount while doing Agent API calls, since
outstanding Agent API calls are removed when the service is
disconnected.
Also remove wispr_portal_context_ref() as it is no longer used.
|
|
connman_wispr_portal_context is initialized with refcount set to one.
Don't reference it an additional times while doing asynchronous calls
if the calls can be cancelled. Unreference the structure when done.
|
|
|
|
Add a '--nobacktrace' command line switch to let the system
handle stack traces. The default is to let ConnMan handle them
as before
|
|
|
|
PrefixLength is exposed as a byte in the API, but code was
waiting for a string when setting a new value.
|
|
An empty AllowedBearers means do not match anything.
|
|
|
|
|
|
|
|
|
|
Up to now an empty or wrong ConnectionType was interpreted as 'any'.
If the ConnectionType is either wrong ignore it. If no ConnectionType
setting is passed in during creation of the session choose 'any'.
|
|
|
|
Up to now an empty AllowedBearers was interpreted as match any. Let's
make the match all explicit by expecting '*'. If an empty
AllowedBearers is provided, we interpret this as no match. In this
case the application will never get an online notifcation.
|
|
|
|
|
|
|
|
Basic types are not used for the configuration anymore.
|
|
Let's ask the plugin for the default configuration. AllowedBearers
and ConnectionType are not yet taken fromt the plugin. Instead
the user configuration will be taken.
|
|
|
|
Whenever a new session is created, the core will ask the plugin
the create the config. This config can then be used by the core
to enforce the user settings.
The owner ship of this config stays in the plugin. Therefore, the plugin
will destroy is later.
|
|
|
|
Instead of passing basic datatypes between the session core and the
policy plugin, provide a complex data structure which holds
the session configuration.
|
|
Rename bearer_info to connman_session_bearer. Use also 'bearer' as local
variable instead of 'info' to avoid confusion with session_info.
|
|
Instead of passing in some string to identify we can use the
connman_session pointer. This allows us to keep the way sessions
are identfied away from the core, e.g. using the D-Bus owner id or
something else.
|
|
|
|
|
|
Let's pick the first plugin. If needed we can add some more smart code
later on.
|
|
The config call will need some context later on. Therefore, create
and initializate with the owner and add the watch on the ownership
before we ask the policy plugin for any configuration.
|
|
|
|
Implement support for per session configuration plugin. Obviously,
this patch itsel is not complete. The code for assigning a
configuration plugin to session->config follows in the next patches.
|
|
Support several session configuration plugins at runtime.
Set the default priority to low for the current policy plugin.
|
|
We don't want to have forwared decleration and the next patches
would make this necessary.
|
|
|
|
|
|
|
|
|
|
|
|
The AvoidHandover boolean was there to fine tune the selection
algorithm in ConnMan. It was never implemented. Let's get rid
for the time beeing. If there is a real need for it we should
implemented this setting through the configuration plugin.
|
|
|
|
|
|
|
|
|
|
The name server refresh should be only done for IPv6
nameservers.
|
|
The AI_PASSIVE is useless here because the server address
is always known.
|
|
There has been cases where send() is returning EINVAL even though
there is a connected the socket. So use sendto() instead and supply
the destination address when sending.
|