Commit a95024d7 authored by Kishen Maloor's avatar Kishen Maloor

Match request conn type in introspection uri

Change-Id: Ie771322c59b255167e98e5e9fa1de66d21bd3d82
Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/29390Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
parent bdd0298e
......@@ -166,6 +166,8 @@ oc_core_introspection_wk_handler(oc_request_t *request,
int interface_index =
(request->origin) ? request->origin->interface_index : -1;
enum transport_flags conn =
(request->origin && (request->origin->flags & IPV6)) ? IPV6 : IPV4;
/* We are interested in only a single coap:// endpoint on this logical device.
*/
oc_endpoint_t *eps = oc_connectivity_get_endpoints(request->resource->device);
......@@ -173,7 +175,7 @@ oc_core_introspection_wk_handler(oc_request_t *request,
memset(&uri, 0, sizeof(oc_string_t));
while (eps != NULL) {
if ((interface_index == -1 || eps->interface_index == interface_index) &&
!(eps->flags & SECURED)) {
!(eps->flags & SECURED) && (eps->flags == conn)) {
if (oc_endpoint_to_string(eps, &ep) == 0) {
oc_concat_strings(&uri, oc_string(ep), "/oc/introspection");
oc_free_string(&ep);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment