platform/upstream/connman.git
11 years agoipconfig: Catch interface name changes
Jukka Rissanen [Tue, 11 Sep 2012 12:01:16 +0000 (15:01 +0300)]
ipconfig: Catch interface name changes

Update the ipdevice interface name if it is changed by udev.

11 years agoagent: Fixes refcounting issue
Tomasz Bursztyka [Thu, 13 Sep 2012 07:32:23 +0000 (10:32 +0300)]
agent: Fixes refcounting issue

Since service is referenced already in the message queue, there is no need
to reference it also in the callback data: this might lead to an over refcount
issue if the queue message is canceled before receiving any answer to it.
(callback's data refcount is still there).

11 years agoproxy: Set lookup to NULL if the tokens did not match
Patrik Flykt [Fri, 7 Sep 2012 08:00:58 +0000 (11:00 +0300)]
proxy: Set lookup to NULL if the tokens did not match

11 years agowispr: Add backpointer to wispr portal structure
Patrik Flykt [Fri, 7 Sep 2012 08:00:57 +0000 (11:00 +0300)]
wispr: Add backpointer to wispr portal structure

When calling free_connman_wispr_portal_context(), the context is
freed. Add a backpointer to the wispr portal context in order to
clear the context from the wispr_portal struct.

11 years agogweb: Don't use debug functionality after possible free
Patrik Flykt [Fri, 7 Sep 2012 08:00:56 +0000 (11:00 +0300)]
gweb: Don't use debug functionality after possible free

When the callback has been called, the whole structure might be
freed. Thus don't call the debug function tied to the structure.

11 years agotethering: Fix error path in __connman_tethering_set_enabled()
Artem Bityutskiy [Fri, 7 Sep 2012 07:04:40 +0000 (10:04 +0300)]
tethering: Fix error path in __connman_tethering_set_enabled()

In some cases we did not destroy the bridge and ip pool.

11 years agotethering: Re-add error message about missing bridge functionality
Artem Bityutskiy [Fri, 7 Sep 2012 06:04:38 +0000 (09:04 +0300)]
tethering: Re-add error message about missing bridge functionality

Commit 4fe07df removed an error message about missing bridge functionality.
Return it back.

11 years agotethering: Fix bridge module loading problem
Artem Bityutskiy [Wed, 5 Sep 2012 14:52:45 +0000 (17:52 +0300)]
tethering: Fix bridge module loading problem

Connman tries to check if bridging is supported by the kernel by checking
whether "/proc/sys/net/bridge" is present. If the bridge is a kernel
module which is not already loaded, then tethering cannot be enabled.

Instead of checking for the file we invoke the "get bridge version" socket
ioctl and the kernel will handle module loading issues - if the bridge
module is not loaded, it will first load it, and then check the version.

11 years agotechnology: Fix memory leak as the tethering strings were not freed
Jukka Rissanen [Wed, 5 Sep 2012 09:10:26 +0000 (12:10 +0300)]
technology: Fix memory leak as the tethering strings were not freed

11 years agoconfig: Call g_clear_error to prevent memory leak
Danny Jeongseok Seo [Mon, 3 Sep 2012 11:45:19 +0000 (20:45 +0900)]
config: Call g_clear_error to prevent memory leak

11 years agotest: set-timeservers was missing from makefile
Jukka Rissanen [Tue, 4 Sep 2012 08:14:54 +0000 (11:14 +0300)]
test: set-timeservers was missing from makefile

11 years agoagent: Always clean up and unref on agent shutdown
Patrik Flykt [Mon, 3 Sep 2012 11:17:15 +0000 (14:17 +0300)]
agent: Always clean up and unref on agent shutdown

11 years agoagent: Cancel agent requests
Patrik Flykt [Mon, 3 Sep 2012 11:17:14 +0000 (14:17 +0300)]
agent: Cancel agent requests

Clean up any queued Agent API messages when the agent disappears or
the service is disconnected. Send cancel to the agent on D-Bus
timeout.

11 years agoagent: Implement Agent API Cancel() method call
Patrik Flykt [Mon, 3 Sep 2012 11:17:13 +0000 (14:17 +0300)]
agent: Implement Agent API Cancel() method call

Clean up the queue and cancel the current message at the agent, if
any. Split out the actual cancel message sending as it will be used
separately from the rest of the code.

11 years agoagent: Use the Agent queueing functions when sending requests
Patrik Flykt [Mon, 3 Sep 2012 11:17:12 +0000 (14:17 +0300)]
agent: Use the Agent queueing functions when sending requests

11 years agoagent: Implement Agent API message queueing
Patrik Flykt [Mon, 3 Sep 2012 11:17:11 +0000 (14:17 +0300)]
agent: Implement Agent API message queueing

Add functions for queuing Agent API messages and sending the
first one when there is no message processed by the agent.

Handle D-Bus pending call replies and simplify the D-Bus reply
processing by handing the message to the callback function.

11 years agoUse g_slist_prepend() where appropriate
Patrik Flykt [Thu, 30 Aug 2012 10:56:14 +0000 (13:56 +0300)]
Use g_slist_prepend() where appropriate

Convert usage of g_slist_append() to g_slist_prepend() where
appropriate. gdbus, dnsproxy, resolver, rtnl, session and session
unit test have ordering requirements and thus not touched.

11 years agosession: Do not track disconnect reason
Daniel Wagner [Mon, 13 Aug 2012 08:40:33 +0000 (10:40 +0200)]
session: Do not track disconnect reason

All session stay in free ride mode all the time. We still
have to know if we have called connect on a service. Therefore
we need to distiguish between reason CONNECT and FREE_RIDE.

11 years agosession: Reorder D-Bus documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:32 +0000 (10:40 +0200)]
session: Reorder D-Bus documentation

Reorder and group the settings, first the read only values
and then the ones which can be changed.

11 years agosession: Move RoamingPolicy to configuration plugin
Daniel Wagner [Mon, 13 Aug 2012 08:40:31 +0000 (10:40 +0200)]
session: Move RoamingPolicy to configuration plugin

The RoamingPolicy setting which should be set by the platform integrator
and not by the application developper is moved the configuration plugin.

11 years agosession: Remove RoamingPolicy documetation
Daniel Wagner [Mon, 13 Aug 2012 08:40:30 +0000 (10:40 +0200)]
session: Remove RoamingPolicy documetation

Remove this setting from the D-Bus API and move to the configuration
plugin.

11 years agosession: Move EmergencyCall to configuration plugin
Daniel Wagner [Mon, 13 Aug 2012 08:40:29 +0000 (10:40 +0200)]
session: Move EmergencyCall to configuration plugin

Instead fallback using the configuration plugin for selecting
the emergency application.

Now we don't have to update all other sessions which makes
the whole code logic more straight forward. If a session is
marked as an emergency call and this application calls
Connect()/Disconnect() it will succedd and block all other
sessions when they try to call Connect() or Disconnect().

11 years agosession: Remove EmergencyCall documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:28 +0000 (10:40 +0200)]
session: Remove EmergencyCall documentation

The EmergencyCall setting which should be set by the platform integrator
and not by the application developer is moved the configuration plugin.

11 years agosession: Remove StayConnected implementation
Daniel Wagner [Mon, 13 Aug 2012 08:40:27 +0000 (10:40 +0200)]
session: Remove StayConnected implementation

11 years agosession: Remove StayConnected documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:26 +0000 (10:40 +0200)]
session: Remove StayConnected documentation

This setting is implicitly already available through AutoConnect.
Having yet another way to express this doesn't make it work any better.

11 years agosession: Move Priority to configuration plugin
Daniel Wagner [Mon, 13 Aug 2012 08:40:25 +0000 (10:40 +0200)]
session: Move Priority to configuration plugin

The Priority setting which should be set by the platform integrator
and not by the application developer is moved the configuration plugin.

11 years agosession: Remove Priority documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:24 +0000 (10:40 +0200)]
session: Remove Priority documentation

Remove this setting from the D-Bus API and move it to the
configuration plugin.

11 years agosession: Add configuration plugin
Daniel Wagner [Mon, 13 Aug 2012 08:40:23 +0000 (10:40 +0200)]
session: Add configuration plugin

11 years agosession: Remove SessionMarker implementation
Daniel Wagner [Mon, 13 Aug 2012 08:40:22 +0000 (10:40 +0200)]
session: Remove SessionMarker implementation

11 years agosession: Remove SessionMarker documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:21 +0000 (10:40 +0200)]
session: Remove SessionMarker documentation

SO_MARK can only be set if the application has the CAP_NET_ADMIN
capability. We don't want to give that to all application for
good reasons and thus this approach won't work. Also touching all
applications to get this feature working is not a good idea. We
are going to use a cgroup controller to set SO_MARK and therefore
we don't need it in the Session API.

11 years agosession: Remove PeriodicConnect implementation
Daniel Wagner [Mon, 13 Aug 2012 08:40:20 +0000 (10:40 +0200)]
session: Remove PeriodicConnect implementation

11 years agosession: Remove PeriodicConnect documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:19 +0000 (10:40 +0200)]
session: Remove PeriodicConnect documentation

The idea was to let ConnMan know and optimize the connection
scheduling. Doing this per Session is a bit over-engineered.
The only use cases that have come up so far was for things like an
email client checking for new message.

Past experience showed that this kind of interface lead easily to
live locks. If there is need for such a feature, doing it on a per
technology would make more sense. For the time beeing it will be
removed. Later it could still be added to the Technology API.

If an application still wants to have a connection on regular
basis it can call the Session Connnect() method. ConnMan is still
able to defer any connection request.

11 years agosession: Update ConnectionType documentation
Daniel Wagner [Mon, 13 Aug 2012 08:40:18 +0000 (10:40 +0200)]
session: Update ConnectionType documentation

The ConnectionType configuration option will be moved to
the config plugin when we know how the application can be
uniquely identified in a persistent way.

11 years agosession: Remove IdleTimeout implementation
Daniel Wagner [Mon, 13 Aug 2012 08:40:17 +0000 (10:40 +0200)]
session: Remove IdleTimeout implementation

11 years agosession: Move IdleTimeout to Technology API
Daniel Wagner [Mon, 13 Aug 2012 08:40:16 +0000 (10:40 +0200)]
session: Move IdleTimeout to Technology API

Having an IdleTimeout per Session is not really reasonable. It is
hard to define the right behavoir if the timeouts differ per Session.

Doing this per technology is easier to understand and also makes
sense when no Session is used.

IdleTimeout is only documented here, it's not yet implemented.

11 years agosession: Update overview doc
Daniel Wagner [Mon, 13 Aug 2012 08:40:15 +0000 (10:40 +0200)]
session: Update overview doc

Update to the new D-Bus API and the simplified connection
algorithms (state).

11 years agoservice: Do not report error twice
Alok Barsode [Wed, 29 Aug 2012 14:07:15 +0000 (17:07 +0300)]
service: Do not report error twice

In request_input_cb(), __connman_service_indicate_error() unconditionally
reports an error via agent after determing the service state. The error
reporting and user connectable state will be properly handled by
service_indicate_state().

11 years agoinet: Properly remove IPv4 address and set interface down
Patrik Flykt [Tue, 28 Aug 2012 07:51:30 +0000 (10:51 +0300)]
inet: Properly remove IPv4 address and set interface down

The interface was not properly set down and thus the services
were not removed.

Fixes BMC#25659

11 years agogdbus: Fix compilation error if macro "error" is defined
Jaganath Kanakkassery [Thu, 16 Aug 2012 12:51:19 +0000 (18:21 +0530)]
gdbus: Fix compilation error if macro "error" is defined

The variable "signature" used in error is not defined and "args" is now
a struct instead of a string.

11 years agopptp: Fix PPTP option typo
Patrik Flykt [Fri, 24 Aug 2012 07:05:04 +0000 (10:05 +0300)]
pptp: Fix PPTP option typo

Fixes BMC#25660

11 years agopptp: Get VPN gateway resolved IP address
Jukka Rissanen [Thu, 23 Aug 2012 11:19:37 +0000 (14:19 +0300)]
pptp: Get VPN gateway resolved IP address

We should not use the Host variable from provider as it can
contain a non-resolved address.

Fixes BMC#25658

11 years agol2tp: Get VPN gateway resolved IP address
Jukka Rissanen [Thu, 23 Aug 2012 11:19:36 +0000 (14:19 +0300)]
l2tp: Get VPN gateway resolved IP address

We should not use the Host variable from provider as it can
contain a non-resolved address.

11 years agoprovider: Return VPN gateway IP address
Jukka Rissanen [Thu, 23 Aug 2012 11:19:35 +0000 (14:19 +0300)]
provider: Return VPN gateway IP address

If 'provider->host_ip[0]' is set, it contains the
resolved IP address. If not set, the 'Host' property
already contains an IP address.

11 years agovpn: Accept also "true" or "1" as a boolean value
Jukka Rissanen [Wed, 22 Aug 2012 08:28:01 +0000 (11:28 +0300)]
vpn: Accept also "true" or "1" as a boolean value

Currently user is able to set the boolean VPN config value
only by setting the variable to "yes". This is not very
intuitive so accept also the value of "true" or "1".

11 years agodevice: Refactor device scan function
Jukka Rissanen [Tue, 21 Aug 2012 10:38:04 +0000 (13:38 +0300)]
device: Refactor device scan function

In wifi plugin this means that we combine three wifi scan
functions (normal, fast, hidden) into one scan function.

11 years agoRelease 1.6 1.6
Marcel Holtmann [Wed, 22 Aug 2012 08:22:36 +0000 (10:22 +0200)]
Release 1.6

11 years agodoc: Manual page for connman configuration file
Jukka Rissanen [Tue, 21 Aug 2012 08:14:45 +0000 (11:14 +0300)]
doc: Manual page for connman configuration file

11 years agodoc: Manual page for connman
Jukka Rissanen [Tue, 21 Aug 2012 08:14:44 +0000 (11:14 +0300)]
doc: Manual page for connman

11 years agogit: Do not ignore connman manual pages
Jukka Rissanen [Tue, 21 Aug 2012 08:14:43 +0000 (11:14 +0300)]
git: Do not ignore connman manual pages

11 years agoservice: Always zero the timeout id when timer triggers
Patrik Flykt [Mon, 20 Aug 2012 12:43:52 +0000 (15:43 +0300)]
service: Always zero the timeout id when timer triggers

The timer id was not cleared in case the signal creation failed.

11 years agoservice: Send updated properties after ServicesChanged
Patrik Flykt [Mon, 20 Aug 2012 12:43:51 +0000 (15:43 +0300)]
service: Send updated properties after ServicesChanged

Updated service properties are not sent before the new service
has been announced in a 'ServicesChanged' signal.

Fixes BMC#21285

11 years agowifi: Ignore duplicate hidden APs
Jukka Rissanen [Tue, 21 Aug 2012 10:55:09 +0000 (13:55 +0300)]
wifi: Ignore duplicate hidden APs

We must not add duplicate entries to list of hidden AP.
There can be more that one service file for each AP if
we have multiple wifi cards in the system.

Fixes BMC#24779

11 years agowifi: Always Scan hidden APs
Jukka Rissanen [Tue, 21 Aug 2012 10:55:08 +0000 (13:55 +0300)]
wifi: Always Scan hidden APs

We should scan hidden AP even if the AP is not marked
as autoconnectable so that the user is able to connect
to it manually.

11 years agowispr: Fix refcounting issue
Tomasz Bursztyka [Tue, 21 Aug 2012 13:45:11 +0000 (16:45 +0300)]
wispr: Fix refcounting issue

11 years agoservice: Restore error clearing on Agent reply
Patrik Flykt [Mon, 20 Aug 2012 09:29:08 +0000 (12:29 +0300)]
service: Restore error clearing on Agent reply

If the invalid key error is not cleared on Agent reply, the
service cannot be reconnected.

11 years agoservice: Allow connection if there are interfaces available
Jukka Rissanen [Mon, 9 Jul 2012 14:17:08 +0000 (17:17 +0300)]
service: Allow connection if there are interfaces available

Allow user to initiate connection if there are multiple devices
of the same technology type available (like having multiple wifi
cards).

11 years agoinet: Clear IP addresses when interface is set down
Patrik Flykt [Thu, 16 Aug 2012 09:21:34 +0000 (12:21 +0300)]
inet: Clear IP addresses when interface is set down

Clear interface IPv4 address by setting it to 0.0.0.0. IPv6
addresses are cleared automatically when the IFF_DYNAMIC flag is
set at the time the interface is brought down.

By removing the IP address and netmask, netlink properly reports
new addresses assigned by DHCPv4.

11 years agoservice: Clear service error on successfull connection attempts
Patrik Flykt [Thu, 16 Aug 2012 09:20:45 +0000 (12:20 +0300)]
service: Clear service error on successfull connection attempts

Move clearing of the error to __connman_service_connect() so it is
cleared for all service connect code paths.

11 years agoipconfig: Use correct ipconfig ipaddress for FIXED method
Patrik Flykt [Thu, 16 Aug 2012 09:20:26 +0000 (12:20 +0300)]
ipconfig: Use correct ipconfig ipaddress for FIXED method

Use ipconfig->address when reporting IP addresses for services
with FIXED method. AUTO method is used only by IPv6, don't report
any addresses should it erroneously appear for IPv4.

Fixes BMC#25084

11 years agotechnology: Move SetProperty to async method call
Tomasz Bursztyka [Fri, 17 Aug 2012 07:16:42 +0000 (10:16 +0300)]
technology: Move SetProperty to async method call

Handle properly -EINPROGRESS error when enabling/disabling technology.
This fixes the existing timeout-based implementation.

11 years agotechnology: Refactor enable/disable technology
Tomasz Bursztyka [Fri, 17 Aug 2012 07:16:41 +0000 (10:16 +0300)]
technology: Refactor enable/disable technology

- Cleanup the code (remove useless vars, remove duplicate code)
- Separate dbus logic to feature logic
- Fixes issue:
"dbus.exceptions.DBusException: net.connman.Error.Failed: Success"

11 years agodundee: Fix error code handling in add_device()
Daniel Wagner [Fri, 17 Aug 2012 07:47:07 +0000 (09:47 +0200)]
dundee: Fix error code handling in add_device()

If no error happens then we should just return and not run
into the cleanup code. And when we cleanup we should not double
free pointers.

11 years agobluetooth: Add the device into hash table when relevant
Tomasz Bursztyka [Thu, 16 Aug 2012 13:36:37 +0000 (16:36 +0300)]
bluetooth: Add the device into hash table when relevant

Fixes BMC#25215

11 years agotimezone: Add comment
Patrik Flykt [Thu, 16 Aug 2012 11:54:31 +0000 (14:54 +0300)]
timezone: Add comment

11 years agotimezone: If there is no d_type support use fstatat()
Andrei Gherzan [Wed, 15 Aug 2012 19:38:51 +0000 (22:38 +0300)]
timezone: If there is no d_type support use fstatat()

This is useful for filesystems where d_type is always DT_UNKNOWN,
for example reiserfs, jffs2 and ubifs. In this case use the
fstatat() function.

11 years agoRelease 1.5 1.5
Marcel Holtmann [Wed, 15 Aug 2012 11:05:17 +0000 (13:05 +0200)]
Release 1.5

11 years agoprovider: Return EINPROGRESS to the caller when connect is pending
Jukka Rissanen [Tue, 14 Aug 2012 14:05:35 +0000 (17:05 +0300)]
provider: Return EINPROGRESS to the caller when connect is pending

11 years agoservice: Remember provider pending dbus message
Jukka Rissanen [Tue, 14 Aug 2012 14:05:34 +0000 (17:05 +0300)]
service: Remember provider pending dbus message

The provider connect dbus reply message is stored in service
until provider is connected.

11 years agoservice: Allow setting path when sending pending dbus reply
Jukka Rissanen [Tue, 14 Aug 2012 14:05:33 +0000 (17:05 +0300)]
service: Allow setting path when sending pending dbus reply

11 years agoconnection: Disconnect VPN when underlaying service disconnects
Jukka Rissanen [Tue, 14 Aug 2012 14:01:03 +0000 (17:01 +0300)]
connection: Disconnect VPN when underlaying service disconnects

Fixes BMC#25128

11 years agoinet: Add function to return route to a given host
Jukka Rissanen [Tue, 14 Aug 2012 14:01:02 +0000 (17:01 +0300)]
inet: Add function to return route to a given host

The netlink message handling is modified from iproute.c in iproute2 package.

11 years agowifi: Try only twice when connecting to a non-favorite service
Julien Massot [Tue, 14 Aug 2012 14:21:46 +0000 (16:21 +0200)]
wifi: Try only twice when connecting to a non-favorite service

11 years agoservice: Add getter for favorite flag
Julien Massot [Tue, 14 Aug 2012 14:21:45 +0000 (16:21 +0200)]
service: Add getter for favorite flag

11 years agoiptables: Load table at the right places
Tomasz Bursztyka [Mon, 13 Aug 2012 10:28:52 +0000 (13:28 +0300)]
iptables: Load table at the right places

Using -j/-m options without -t one, will segfault due to table not loaded
before hand.

11 years agoiptables: Refactor default return code usage
Tomasz Bursztyka [Mon, 13 Aug 2012 10:28:51 +0000 (13:28 +0300)]
iptables: Refactor default return code usage

11 years agotools: Refactor where table should be loaded
Tomasz Bursztyka [Mon, 13 Aug 2012 10:28:50 +0000 (13:28 +0300)]
tools: Refactor where table should be loaded

Fixes segfault issues when using a non-builtin target without providing table name.
like: -A OUTPUT -j IDLETIMER (...)
will crash when: -t filter -A OUTPUT -j IDLETIMER (...) will success

11 years agoservice: Disconnect provider after connection timeout
Jukka Rissanen [Mon, 13 Aug 2012 09:51:31 +0000 (12:51 +0300)]
service: Disconnect provider after connection timeout

The provider was not disconnected after a connection timeout.
This lead to weird issues in VPN code; like following provider
connect request would disconnect the earlier VPN connection and
report EALREADY to the user.

11 years agodoc: Improve description of service state property
Lucas De Marchi [Wed, 8 Aug 2012 16:23:59 +0000 (13:23 -0300)]
doc: Improve description of service state property

Add missing "disconnect" state and point to doc/overview-api.txt for
more information about state transitions.

11 years agodundee Create ipconfig before setting index
Daniel Wagner [Fri, 10 Aug 2012 12:23:18 +0000 (14:23 +0200)]
dundee Create ipconfig before setting index

Since connman_network_set_index() does not create magically the
ipconfig for us anymore, we need to create it inside set_connected().

11 years agobluetooth: Defer add_networks() if adapter is not powered yet
Daniel Wagner [Thu, 9 Aug 2012 16:27:53 +0000 (18:27 +0200)]
bluetooth: Defer add_networks() if adapter is not powered yet

In the case we add a new adapter and the adapter is powered off
we would ignore the reported devices. Later when the adapter was
powered on it would just not add those networks.

Instead silently ignoring the devices, store the D-Bus paths in
a hash table and process them as soon the adapter is powered.

Fixes BMC#25322

11 years agobluetooth: Remove unused argument in check_networks()
Daniel Wagner [Thu, 9 Aug 2012 16:27:52 +0000 (18:27 +0200)]
bluetooth: Remove unused argument in check_networks()

11 years agobluetooth: Remove unused argument in add_network()
Daniel Wagner [Thu, 9 Aug 2012 16:27:51 +0000 (18:27 +0200)]
bluetooth: Remove unused argument in add_network()

11 years agoofono: Set IPv6 nameservers
Daniel Wagner [Fri, 10 Aug 2012 09:59:04 +0000 (11:59 +0200)]
ofono: Set IPv6 nameservers

11 years agonetwork: Enable IPv6 on network interface
Elena Tebesoi [Fri, 10 Aug 2012 09:59:03 +0000 (11:59 +0200)]
network: Enable IPv6 on network interface

This patch enables IPv6 usage for network interfaces
with static/manual configuration.

11 years agoipconfig: Allow NULL gateway for IPv6
Elena Tebesoi [Fri, 10 Aug 2012 09:59:02 +0000 (11:59 +0200)]
ipconfig: Allow NULL gateway for IPv6

This patch makes possible configuring a GPRS connection with
IPV6 settings and without gateway.

11 years agoofono: Create ipconfig before setting index
Daniel Wagner [Fri, 10 Aug 2012 09:59:01 +0000 (11:59 +0200)]
ofono: Create ipconfig before setting index

Since connman_network_set_index() does not create magically the
ipconfig for us anymore, we need to create it inside set_connected().

11 years agonetwork: Only set index in connman_network_set_index()
Daniel Wagner [Fri, 10 Aug 2012 09:59:00 +0000 (11:59 +0200)]
network: Only set index in connman_network_set_index()

Service ipconfig structures are no longer created in this
function.

11 years agoservice: Allow plugins to lookup services by networks
Daniel Wagner [Fri, 10 Aug 2012 09:58:59 +0000 (11:58 +0200)]
service: Allow plugins to lookup services by networks

11 years agoservice: Allow plugins access to connman_service_create_ip4/6config
Daniel Wagner [Fri, 10 Aug 2012 09:58:58 +0000 (11:58 +0200)]
service: Allow plugins access to connman_service_create_ip4/6config

11 years agotechnology: Save tethering identifier and passphrase
Julien Massot [Tue, 7 Aug 2012 16:57:06 +0000 (18:57 +0200)]
technology: Save tethering identifier and passphrase

11 years agotechnology: Rename save_state function by technology_save
Julien Massot [Tue, 7 Aug 2012 16:57:05 +0000 (18:57 +0200)]
technology: Rename save_state function by technology_save

11 years agodundee: Clean up device in case of setup failure
Gustavo Padovan [Thu, 9 Aug 2012 21:57:26 +0000 (18:57 -0300)]
dundee: Clean up device in case of setup failure

If the creation and registration of Bluetooth DUN device fails we need to
clean up before return, otherwise we leak memory.

11 years agobluetooth: Add device to hash before registration
Gustavo Padovan [Thu, 9 Aug 2012 21:57:25 +0000 (18:57 -0300)]
bluetooth: Add device to hash before registration

During the connman_device_register() procedure a lookup to the
bluetooth_devices hash table happens, however the device is not on the
hash at this point and the look out fails.

If the registration fails, technology_disable() returns the Failed
message on D-Bus with the error status zero. That happens because we
don't have any device registered.

This patch moves the insertion of the device to before the device
registration.

11 years agodhcp: Apply received hostname option according to conf file setting
Jukka Rissanen [Fri, 10 Aug 2012 08:21:26 +0000 (11:21 +0300)]
dhcp: Apply received hostname option according to conf file setting

We do not use the received DHCP hostname option (12) if system
config file setting says so.

Fixes BMC#25597

11 years agomain: Introduce conf file option to disable hostname updates
Jukka Rissanen [Fri, 10 Aug 2012 08:21:25 +0000 (11:21 +0300)]
main: Introduce conf file option to disable hostname updates

The AllowHostnameUpdates in system config file can be used
to ignore the hostname update request that for example
can be received via DHCP hostname option.

11 years agoprovider: Discard routes to VPN server via VPN tunnel
Jukka Rissanen [Wed, 8 Aug 2012 10:22:48 +0000 (13:22 +0300)]
provider: Discard routes to VPN server via VPN tunnel

These obsolete routes must be discarded as we cannot
contact VPN server via VPN tunnel. If the VPN server
address is not yet resolved, we do that while starting
the VPN client process.

Example of non working routes:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         UG    0      0        0 vpn0
10.10.15.0      0.0.0.0         255.255.255.0   U     0      0        0 wlan0
10.10.15.1      0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
10.252.112.0    0.0.0.0         255.255.240.0   U     0      0        0 vpn0
193.229.0.40    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
193.229.0.42    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
113.108.211.91  0.0.0.0         255.255.255.255 UH    0      0        0 vpn0
113.108.211.91  10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0

The correct routes should be like this:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 vpn0
10.10.15.0      0.0.0.0         255.255.255.0   U     0      0        0 wlan0
10.10.15.1      0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
10.252.112.0    0.0.0.0         255.255.240.0   U     0      0        0 vpn0
193.229.0.40    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
193.229.0.42    10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0
113.108.211.91  10.10.15.1      255.255.255.255 UGH   0      0        0 wlan0

11 years agoprovider: Allow VPN connection if not in connected state
Jukka Rissanen [Wed, 8 Aug 2012 10:22:47 +0000 (13:22 +0300)]
provider: Allow VPN connection if not in connected state

Allow user to connect to VPN via dbus and supplying all
VPN parameters if the provider already exists but the VPN
is not in connected state.

This means that the user can call the Manager.ConnectProvider interface
multiple times to connect to VPN service. This patch is needed so that
OpenConnect can work correctly. Without this patch the OpenConnect cookie
cannot be passed to openconnect client program.

11 years agoconnection: Set VPN default route to the VPN interface
Jukka Rissanen [Wed, 8 Aug 2012 10:22:46 +0000 (13:22 +0300)]
connection: Set VPN default route to the VPN interface

Do not bother setting individual routes for default gateway so
for VPN we set the whole interface as a default gateway route.

11 years agoconnection: Add more debugging when setting VPN routes
Jukka Rissanen [Wed, 8 Aug 2012 10:22:45 +0000 (13:22 +0300)]
connection: Add more debugging when setting VPN routes

11 years agoservice: Signal error property changes
Grant Erickson [Wed, 8 Aug 2012 16:59:27 +0000 (09:59 -0700)]
service: Signal error property changes

In order to allow clients to update the property in a manner similar to
other service properties, signal changes in the service "Error" property
key/value pair.

The value "" is used when no error is asserted because D-Bus property
changed convention has no semantics for indicating a key/value pair was
removed.