platform/upstream/connman.git
12 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.

12 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

12 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

12 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.

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

12 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.

12 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).

12 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.

12 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.

12 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

12 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.

12 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"

12 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.

12 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

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

12 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.

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

12 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

12 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.

12 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

12 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

12 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.

12 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

12 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

12 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.

12 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

12 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

12 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.

12 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.

12 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().

12 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

12 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()

12 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()

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

12 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.

12 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.

12 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().

12 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.

12 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

12 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

12 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

12 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

12 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.

12 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.

12 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

12 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.

12 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

12 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.

12 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.

12 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

12 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.

12 years agoservice: Initiate autoconnect after changing ipconfig method
Jukka Rissanen [Tue, 7 Aug 2012 14:08:41 +0000 (17:08 +0300)]
service: Initiate autoconnect after changing ipconfig method

12 years agoservice: Do not set the service state when changing IPv4 method
Jukka Rissanen [Tue, 7 Aug 2012 14:08:40 +0000 (17:08 +0300)]
service: Do not set the service state when changing IPv4 method

The service state will be set to proper state if we are
actually doing the connection so do not set the state
when we are just setting the IPv4 method.

12 years agoservice: Do not try to connect to service that cannot create connection
Jukka Rissanen [Tue, 7 Aug 2012 14:08:39 +0000 (17:08 +0300)]
service: Do not try to connect to service that cannot create connection

Check if the service IPv4/6 ipconfig is turned OFF, in this
case do not try to connect to that service because it will
not succeed.

Fixes BMC#25587

12 years agoipconfig: Add function to check if the ipconfig is OFF
Jukka Rissanen [Tue, 7 Aug 2012 14:08:38 +0000 (17:08 +0300)]
ipconfig: Add function to check if the ipconfig is OFF

12 years agomain: Add support for specifying a non-default configuration file.
Grant Erickson [Tue, 7 Aug 2012 15:12:35 +0000 (08:12 -0700)]
main: Add support for specifying a non-default configuration file.

This patch adds support for specifying a main configuration file
different from the default value of /etc/connman/main.conf. This
is valuable during debug to specify alternate debug-only
configurations.

12 years agomain: Remove unused compat argument
Daniel Wagner [Mon, 6 Aug 2012 16:34:06 +0000 (18:34 +0200)]
main: Remove unused compat argument

12 years agostorage.c: Search for settings file even if d_type is DT_UNKNOWN.
Andrei Gherzan [Mon, 6 Aug 2012 20:54:33 +0000 (23:54 +0300)]
storage.c: Search for settings file even if d_type is DT_UNKNOWN.

This is useful for filesystems where d_type is always DT_UNKNOWN,
for example in reiserfs.

12 years agoTODO: Add WiMAX removal task
Patrik Flykt [Mon, 6 Aug 2012 06:05:19 +0000 (09:05 +0300)]
TODO: Add WiMAX removal task

12 years agodevice: Remove unused phyindex
Daniel Wagner [Fri, 3 Aug 2012 11:30:14 +0000 (13:30 +0200)]
device: Remove unused phyindex

12 years agoRelease 1.4 1.4
Marcel Holtmann [Tue, 24 Jul 2012 21:10:50 +0000 (23:10 +0200)]
Release 1.4

12 years agowifi: Return -EBUSY when tethering
Tomasz Bursztyka [Tue, 24 Jul 2012 13:28:02 +0000 (16:28 +0300)]
wifi: Return -EBUSY when tethering

Fixes BMC#25561

12 years agowispr: Add a reference counter mechanism on contexts
Tomasz Bursztyka [Tue, 17 Jul 2012 13:32:06 +0000 (16:32 +0300)]
wispr: Add a reference counter mechanism on contexts

Basically, wispr provides a pointer (a wispr/portal context) to third parties
(agent, gweb...) which are answering asynchronously. However, if the technology
related to the service owning such context is disabled: this context is not
valid anymore, leading to a crash when third part answers after such action.

In order to avoid such issue, wispr implement an internal refcount system.

Fixes BMC#25479

12 years agoAUTHORS: Mention Ross' contributions
Daniel Wagner [Wed, 18 Jul 2012 10:56:10 +0000 (12:56 +0200)]
AUTHORS: Mention Ross' contributions

12 years agodoc: Add coding-style.txt
Samuel Ortiz [Wed, 18 Jul 2012 10:23:49 +0000 (12:23 +0200)]
doc: Add coding-style.txt

This is a copy of the oFono coding-style document, with oFono instances
replaced with ConnMan ones.
It's also in sync with the neard one.

12 years agostorage: check that the string isn't empty before splitting
Ross Burton [Wed, 18 Jul 2012 09:37:38 +0000 (10:37 +0100)]
storage: check that the string isn't empty before splitting

If the string was non-NULL but empty (str="\0"), the following \0 assignment
would write to str[-1] and thus cause memory corruption.

On PPC and MIPS, this was causing crashes in glibc.

12 years agodevice: Do not set regdom when device is not powered
Tomasz Bursztyka [Wed, 11 Jul 2012 06:59:40 +0000 (09:59 +0300)]
device: Do not set regdom when device is not powered

Fixes crash bug:
connmand[6761]: plugins/ofono.c:get_properties_reply() /huawei_0 path /huawei_0 org.ofono.NetworkRegistration
connmand[6761]: plugins/ofono.c:netreg_properties_reply() /huawei_0
connmand[6761]: plugins/ofono.c:netreg_update_regdom() /huawei_0 MobileContryCode 460
connmand[6761]: src/device.c:connman_device_ref_debug() 0x8686ac0 ref 3 by plugins/wifi.c:991:wifi_set_regdom()
connmand[6761]: Aborting (signal 11) [src/connmand]
connmand[6761]: ++++++++ backtrace ++++++++
connmand[6761]: #0  0xb7749400 in
connmand[6761]: #1  0x806aa0b in g_supplicant_interface_set_country() at nat.c:0
connmand[6761]: #2  0x8062297 in wifi_set_regdom() at wifi.c:0
connmand[6761]: #3  0x80a607d in connman_technology_set_regdom() at ??:0
connmand[6761]: #4  0x806fefb in netreg_update_regdom() at ofono.c:0
connmand[6761]: #5  0x8071f3b in netreg_properties_reply() at ofono.c:0
connmand[6761]: #6  0x806f747 in get_properties_reply() at ofono.c:0
connmand[6761]: #7  0x4a374b62 in /usr/lib/libdbus-1.so.3
connmand[6761]: #8  0x4a3602b7 in /usr/lib/libdbus-1.so.3
connmand[6761]: #9  0x4a3639f5 in /usr/lib/libdbus-1.so.3
connmand[6761]: #10 0x8054250 in message_dispatch() at mainloop.c:0
connmand[6761]: #11 0x49f3e9d7 in /lib/libglib-2.0.so.0
connmand[6761]: #12 0x49f3de38 in /lib/libglib-2.0.so.0
connmand[6761]: #13 0x49f3e13e in /lib/libglib-2.0.so.0
connmand[6761]: #14 0x49f3e5a6 in /lib/libglib-2.0.so.0
connmand[6761]: #15 0x8053ab6 in main() at nat.c:0
connmand[6761]: #16 0x49cfc4c4 in /lib/libc.so.6
connmand[6761]: +++++++++++++++++++++++++++

12 years agogdhcp: Set client state to INIT_SELECTING on restart
Forest Bond [Mon, 16 Jul 2012 13:09:01 +0000 (09:09 -0400)]
gdhcp: Set client state to INIT_SELECTING on restart

With the previous behavior, we would end up sending a discover message
and then ignoring the reply due to the client state mismatch, so a
restart would never result in successful acquisition of a lease.

RFC 2131 specifies that the client should return to INIT state in
various restart scenarios.  However, also note that it would not make
sense in any case to send a discover message and ignore the reply.

12 years agortnl: Support PPP connections
Forest Bond [Wed, 20 Jun 2012 21:06:28 +0000 (17:06 -0400)]
rtnl: Support PPP connections

The ARP header type for PPP connections is ARPHRD_PPP (512).

12 years agogresolv: Use predefined mnemonics rather than magic numbers
Grant Erickson [Mon, 16 Jul 2012 16:48:10 +0000 (09:48 -0700)]
gresolv: Use predefined mnemonics rather than magic numbers

Use predefined mnemonics from arpa/nameserv.h for the return value from
ns_msg_getflag rather than magic numbers.

12 years agogresolv: Do not update successful status with unsuccessful one
Grant Erickson [Mon, 16 Jul 2012 16:48:09 +0000 (09:48 -0700)]
gresolv: Do not update successful status with unsuccessful one

When performing a resolver lookup from timeserver or wpad, both perform
queries with an unspecified address family. This means that both A and
AAAA record queries are issued. In cases where a valid, successful A
response comes back but where the AAAA query results in a timeout, do
not smash the successful A status with the time out AAAA status;
otherwise, the timeserver or wpad will appear to fail to them when, in
fact, the A query was successful and more than satisfies its unspecified
address family requirement.

Partial fix for BMC#25486.

12 years agogresolve: Fix a typo in conditional check for returning results
Grant Erickson [Mon, 16 Jul 2012 16:48:08 +0000 (09:48 -0700)]
gresolve: Fix a typo in conditional check for returning results

In both parse_response and query_timeout there exists logic that checks
to ensure that both an A and AAAA lookups have either been responded to
or timed out before processing and returning results to the caller. In
query_timeout, there was a typo in the condition check such that it did
not match those conditions tested in parse_response.

12 years agontp: Add debug message when starting NTP against resolved server
Grant Erickson [Mon, 16 Jul 2012 16:48:07 +0000 (09:48 -0700)]
ntp: Add debug message when starting NTP against resolved server

This patch adds an analagous debug message when starting NTP against a
resolved server as when starting against a numbered server.

12 years agontp: Fixed a debug message typo
Grant Erickson [Mon, 16 Jul 2012 16:48:06 +0000 (09:48 -0700)]
ntp: Fixed a debug message typo

12 years agontp: Retry a given server address multiple times before falling back
Grant Erickson [Mon, 16 Jul 2012 16:48:05 +0000 (09:48 -0700)]
ntp: Retry a given server address multiple times before falling back

This patch causes the internal NTP client to retry a given server
address up to three times (four total attempts) at a two second interval
before falling back to another server name or server address.

12 years agontp: Use mnemonic when specifying the request precision
Grant Erickson [Mon, 16 Jul 2012 16:48:04 +0000 (09:48 -0700)]
ntp: Use mnemonic when specifying the request precision

This patch uses a mnemonic to specify the request precision and also
adds a comment how a future implementation might pass along the actual
system wall clock precision.

12 years agontp: Add mnemonics for common clock precisions
Grant Erickson [Mon, 16 Jul 2012 16:48:03 +0000 (09:48 -0700)]
ntp: Add mnemonics for common clock precisions

12 years agontp: Use mnemonics when checking reply flags
Grant Erickson [Mon, 16 Jul 2012 16:48:02 +0000 (09:48 -0700)]
ntp: Use mnemonics when checking reply flags

Use mnemonics when checking reply flags and print out information in
debug mode about why the reply flags were rejected.

12 years agontp: Specify leap-not-in-sync in flags
Grant Erickson [Mon, 16 Jul 2012 16:48:01 +0000 (09:48 -0700)]
ntp: Specify leap-not-in-sync in flags

This patch sets the non-in-sync flag of the leap subfield of the packet
flags field. This reflects behavior implemented by ntpdate or ntpd in
one-shot mode.

12 years agontp: Send a transmit time value that reflects current system time
Grant Erickson [Mon, 16 Jul 2012 16:48:00 +0000 (09:48 -0700)]
ntp: Send a transmit time value that reflects current system time

This sets the ntp request packet transmit time to the current system
time to reflect behavior implemented by ntpdate and ntpd in one-shot
mode.

12 years agontp: Use mnemonics rather than magic numbers
Grant Erickson [Mon, 16 Jul 2012 16:47:59 +0000 (09:47 -0700)]
ntp: Use mnemonics rather than magic numbers

Convert a magic number into equivalent mnemonics for the flags (leap,
version, mode) packet field.

12 years agontp: Add mnemonics for the flags (leap, version, mode) packet field
Grant Erickson [Mon, 16 Jul 2012 16:47:58 +0000 (09:47 -0700)]
ntp: Add mnemonics for the flags (leap, version, mode) packet field

12 years agotimeserver: Try all resolved timeserver IP addresses
Jukka Rissanen [Mon, 16 Jul 2012 08:00:47 +0000 (11:00 +0300)]
timeserver: Try all resolved timeserver IP addresses

If we get more than one IP address, then add those
server addresses to the time server list so that they
can be tried if the first entry fails.

12 years agontp: If the server cannot be contacted, try next one
Jukka Rissanen [Mon, 16 Jul 2012 08:00:46 +0000 (11:00 +0300)]
ntp: If the server cannot be contacted, try next one

This could happen if the network routes are not yet setup
so the sendto() could fail. In this case try next address and
hope for the best. This is a rare issue but I have seen it
couple of times.

12 years agoRevert "build: Use -Wshadow compiler option"
Marcel Holtmann [Mon, 16 Jul 2012 13:12:05 +0000 (10:12 -0300)]
Revert "build: Use -Wshadow compiler option"

12 years agobuild: Use -Wshadow compiler option
Marcel Holtmann [Sun, 15 Jul 2012 22:59:19 +0000 (19:59 -0300)]
build: Use -Wshadow compiler option

12 years agodnsproxy: Avoid multiple shadowing variables
Marcel Holtmann [Sun, 15 Jul 2012 22:58:46 +0000 (19:58 -0300)]
dnsproxy: Avoid multiple shadowing variables

12 years agotethering: Avoid shadowing connection variable
Marcel Holtmann [Sun, 15 Jul 2012 22:55:07 +0000 (19:55 -0300)]
tethering: Avoid shadowing connection variable

12 years agosession: Avoid shadowing hash table iterator
Marcel Holtmann [Sun, 15 Jul 2012 22:54:14 +0000 (19:54 -0300)]
session: Avoid shadowing hash table iterator

12 years agosession: Avoid shadowing session info variable
Marcel Holtmann [Sun, 15 Jul 2012 22:53:13 +0000 (19:53 -0300)]
session: Avoid shadowing session info variable

12 years agoconfig: Avoid shadowing config structure variable
Marcel Holtmann [Sun, 15 Jul 2012 22:51:11 +0000 (19:51 -0300)]
config: Avoid shadowing config structure variable

12 years agocounter: Avoid shadowing connection variable
Marcel Holtmann [Sun, 15 Jul 2012 22:50:29 +0000 (19:50 -0300)]
counter: Avoid shadowing connection variable

12 years agonotifier: Avoid shadowing connected variable
Marcel Holtmann [Sun, 15 Jul 2012 22:43:17 +0000 (19:43 -0300)]
notifier: Avoid shadowing connected variable

12 years agoagent: Avoid shadowing connection variable
Marcel Holtmann [Sun, 15 Jul 2012 22:41:18 +0000 (19:41 -0300)]
agent: Avoid shadowing connection variable

12 years agoservice: Avoid shadowing string variable
Marcel Holtmann [Sun, 15 Jul 2012 22:40:49 +0000 (19:40 -0300)]
service: Avoid shadowing string variable

12 years agotask: Avoid shadowing connection variable
Marcel Holtmann [Sun, 15 Jul 2012 22:39:51 +0000 (19:39 -0300)]
task: Avoid shadowing connection variable

12 years agoplugins: Avoid shadowing connection variable
Marcel Holtmann [Sun, 15 Jul 2012 22:39:24 +0000 (19:39 -0300)]
plugins: Avoid shadowing connection variable

12 years agogsupplicant: Avoid shadowing key variable
Marcel Holtmann [Sun, 15 Jul 2012 22:31:28 +0000 (19:31 -0300)]
gsupplicant: Avoid shadowing key variable

12 years agounit: Avoid shadowing session info variable
Marcel Holtmann [Sun, 15 Jul 2012 22:31:06 +0000 (19:31 -0300)]
unit: Avoid shadowing session info variable

12 years agotools: Avoid shadowing buffer variable
Marcel Holtmann [Sun, 15 Jul 2012 22:30:38 +0000 (19:30 -0300)]
tools: Avoid shadowing buffer variable