flimflam: dns_client: use nameservers configured for specified interface

Modify dns_client to use the nameservers configured for the interface
passed to connman_dns_client_submit_request rather than the default
nameservers. This is necessary because the default nameservers may not
be reachable via the specified interface.

This CL also fixes a few other issues discovered during testing:
- Print __func__ in calls to connman_error
- Ignore NULL or stopped requests in calls to
  connman_dns_client_cancel_request. This removes the burden from
  clients to know when it's ok to call this function. They can now call it
  at any time.
- Pass full sockaddr_in[6] structs to clients rather than sin[6]_addr structs.

BUG=chromium-os:17920
TEST=Tested with hostroute plugin CL at https://gerrit.chromium.org/gerrit/7010
Verification steps:
- Ensure that the DUT has both an ethernet connection and a 3G data plan.
- Visit chrome://settings/internet and disable mobile data
- /usr/local/lib/flimflam/test/debug service+resolv+hostroute
- Visit chrome://settings/internet, enable mobile data, and connect to 3G.
- Inspect /var/log/messages for flimflam debug messages tracing dns_client
  operation.
- Note that the nameservers for the 3G interface are being used instead
  of the nameservers for the ethernet interface.

Change-Id: I64fde38527cd7e6e06688aeda93319db60aa45a2
Reviewed-on: https://gerrit.chromium.org/gerrit/11445
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Vince Laviano <vlaviano@chromium.org>
2 files changed