Temp fix for broken multicast presence after WiFi/Ethernet merge.
authorMandeep Shetty <mandeep.shetty@intel.com>
Thu, 7 May 2015 00:04:56 +0000 (17:04 -0700)
committerUze Choi <uzchoi@samsung.com>
Thu, 7 May 2015 04:18:30 +0000 (04:18 +0000)
This is a temporary fix.
The multicast notifications from server side need remote endpoint to be
null in caipadapter.c::CAIPSendDataThread().
But the function signature called from the RI layer into the CA layer
to send responses takes a CARemoteEndpoint struct which cannot be null.

The temp fix is to make caipclient.c think that a response is multicast if
the remoteAddress is the fixed multicast ip 224.0.1.187.

Change-Id: I6720ceb123d044b9c2aa510d41488b5003324e4e
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/922
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/connectivity/src/ip_adapter/caipclient.c

index 7cb40df..2f9cfd0 100644 (file)
@@ -32,6 +32,7 @@
  * @brief Logging tag for module name
  */
 #define IP_CLIENT_TAG "IP_CLIENT"
+#define OC_MULTICAST_IP "224.0.1.187"
 
 static uint32_t CASendData(const char *remoteAddress, uint16_t port, const void *data,
                            uint32_t dataLength, int sockfd)
@@ -98,7 +99,7 @@ uint32_t CAIPSendData(const char *remoteAddress, uint16_t remotePort, const void
     }
 
     uint32_t len = 0;
-    if (isMulticast)
+    if (isMulticast || strcmp(remoteAddress, OC_MULTICAST_IP) == 0)
     {
         uint32_t listIndex = 0;
         uint32_t listLength = u_arraylist_length(tempServerInfoList);