connectivity: fix getnameinfo() call for musl libc
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 26 Oct 2015 21:42:40 +0000 (22:42 +0100)
committerJon A. Cruz <jonc@osg.samsung.com>
Mon, 7 Dec 2015 20:19:37 +0000 (20:19 +0000)
commit837044702fae83f864445eaf7cbf2644e929c9b9
tree83734a87c9851bac0550fc488925617976ddc632
parent72c897594ef9e8ee7ba95d82e1264d0b8ce8ce34
connectivity: fix getnameinfo() call for musl libc

The musl libc and also the libc from net/freebsd are currently checking
if the size of the sockaddr given to getnameinfo() matches the size for
this family and it fails when giving sizeof(struct sockaddr_storage).
This patch fixes this problem by making the caller also provide the
size of the struct sockaddr_storage.

I am currently trying to get a fix for this problem into musl libc, but
IoTivity should still fix this.

This also fixes a wrong error message.

Fix for [IOT-834]

Change-Id: Ie9b89523b5ba20e536c03e3ad85c65bd5ff2ba53
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3959
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
(cherry picked from commit 9db6f3452c76af909218e2b561467fcd208b413d)
Reviewed-on: https://gerrit.iotivity.org/gerrit/4439
resource/csdk/connectivity/inc/caadapterutils.h
resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c
resource/csdk/connectivity/src/adapter_util/caadapterutils.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c