network: Function name was missing a proper prefix
network: Set service disconnect state correctly

If a connecting or associating network was disconnected, then
the corresponding service was left in associating state.
The fix is to check that we are not just in connected state,
but also connecting or associating network states are fine. In
this case the service state will be set correctly to idle.
The ip address etc. are only disabled/removed if we were in
connected state.

Fixes BMC#25981
ipconfig: Add support function to return ipconfig IPv6 status
ipv6pd: Check IPv6 support

If IPv6 is not supported by the kernel, then do not activate
prefix delegation.
ipv6pd: Change PD status according to uplink IPv6 status

Start to monitor ipconfig changes. If the uplink IPv6 ipconfig
changes, then either stop or start PD depending on if it was
active or not.
nfacct: netlink uses positive error codes
netlink-test: Use assertion to verify results

nfacct_get() and nfacct_dump() do also notify the callee with
name == NULL the end of the get/dump.

While we touch test_nfacct_new_callback() we rename it
to test_nfacct_callback() because it is used for NEW/DEL operation.
nfacct: Do not fail in nfacct_flush_cb() when NFACCT is not supported

Netlink will return EINVAL when the NFACCT subsystem doesn't exists.
In this case we just ignore it and go on.

Move also the DBG() down, so we don't see the last call notification
from the layer below.
tethering: Add debug print so we notice restarts
tethering: Use the prefix length from ippool instead of hard coded value

We were always using prefix length 24 instead of the correct
value from ippool.
connection: Use netlink functions to set default gateway

We were using earlier the ioctl() to set the default gateway.
In some cases that could fail because the desired interface
was not set when calling the ioctl().
This happened with tethering with following scenario:
* Ethernet cable (uplink connection) is not connected
* Wifi tethering is started with address 192.168.1.1
* Ethernet cable is connected, uplink address is 192.168.1.0/24
* There is now a conflict, ippool resolves that in __connman_ippool_newaddr()
  and calls tethering_restart() which stops and then starts tethering
* Because of the problems when calling the SIOCADDRT (we do not know
  to what interface the default route was added to), the default route
  of uplink connection was added to tethering interface (tether) instead
  of uplink interface (eth0). This caused the default route to disappear
  when tether interface was taken down.
* Solution was to use the netlink interface to set the default gateway
  as we can unambiguously set the desired default route to be via the
  uplink interface

Thanks for Stephan Raue for reporting this issue.
inet: Remove unused gateway setting functions

No need for these functions anymore as we are using the netlink
variants to set the default gateway.
tethering: Cleanup tethering when connman is shutting down

We do not want to leave the tether interface and bridge hanging
around after shutdown.
dhcpv6: Enable checking of reply error codes

As specified in RFC 3315 chapter 18.1.8, we must check the reply
error codes and retransmit the message if needed. This commit
is a preparation for actual error check code.
dhcpv6: Most of the reply error handling was missing

The tests described in page 53
chapter Test DHCP_CONF.1.3.3: Client Initiated Exchange - Reception
of Reply messages in this document
https://www.ipv6ready.org/docs/Phase2_DHCPv6_Conformance_Latest.pdf
were failing.
This patch fixes these tests: A, B, C, D, E, H, J
dhcpv6: Set addresses from CONFIRM reply if status is ok

Only set the IP addresses from CONFIRM message reply,
if the status of the reply message is success.
dhcpv6: Set addresses after we have checked the status code

Do not blindly assign addresses when receiving renew or rebind
reply message, but check the returned DHCP status code before
setting addresses.
doc: Document openconnect certificate and server options
openconnect: Request missing openconnect information

Request missing openconnect information from the Agent. Provide
OpenConnect.CACert and OpenConnect.ClientCert informational fields
and request mandatory OpenConnect.Cookie and OpenConnect.ServerCert
fields.
openconnect: Move code earlier in the file

Make the next patches smaller by moving code earlier in the file.