+ // below code is temporary impl for consistency with caipserver.
+ // TODO: whole code which using ioctl will be removed and changed with internal getifaddrs impl.
+ if (foundNewInterface)
+ {
+ iflist = u_arraylist_create();
+
+ if (!iflist)
+ {
+ OIC_LOG_V(ERROR, TAG, "Failed to create iflist: %s", strerror(errno));
+ goto exit;
+ }
+
+ CAResult_t result = CAAddInterfaceItem(iflist,
+ foundNewInterface->index,
+ foundNewInterface->name,
+ foundNewInterface->family,
+ foundNewInterface->addr,
+ foundNewInterface->flags);
+ if (CA_STATUS_OK != result)
+ {
+ goto exit;
+ }
+
+ // release foundNewInterface
+ OICFree(foundNewInterface);
+ foundNewInterface = NULL;
+ }
+ return iflist;
+exit:
+ OICFree(foundNewInterface);
+ foundNewInterface = NULL;
+ u_arraylist_destroy(iflist);
+ return NULL;