[IOT-1840] Fix incorrect check for IPv4 when generating endpoint
authorTodd Malsbary <todd.malsbary@intel.com>
Wed, 22 Feb 2017 17:26:06 +0000 (09:26 -0800)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Sat, 25 Feb 2017 00:02:11 +0000 (00:02 +0000)
string.

Bug: https://jira.iotivity.org/browse/IOT-1840
Change-Id: I6950ba6a06965f94848d7fb53d13f416fa4906b3
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17431
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/stack/src/ocendpoint.c

index 93711ed..f4d248d 100644 (file)
@@ -245,7 +245,7 @@ char* OCCreateEndpointString(const OCEndpointPayload* endpoint)
         )
     {
         // checking addr is ipv4 or not
-        if (endpoint->family == OC_IP_USE_V4)
+        if (endpoint->family & OC_IP_USE_V4)
         {
             // ipv4
             sprintf(buf, "%s://%s:%d", endpoint->tps, endpoint->addr, endpoint->port);