Skip to content

Commit 642c258

Browse files
Cristib05kartben
authored andcommitted
openthread: platform: dns_upstream_resolver: Fix bug in platform code
Fix an incorrect type cast when trying to obtain an otPlatDnsUpstreamQuery pointer from user data passed to dns resolver module. Signed-off-by: Cristian Bulacu <[email protected]>
1 parent 8d7c2e1 commit 642c258

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/openthread/platform/dns_upstream_resolver.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,8 @@ static struct query_context *get_query_by_ot_transaction(otPlatDnsUpstreamQuery
196196

197197
static struct query_context *get_query_by_user_data(void *user_data)
198198
{
199-
struct query_context *ctx;
200-
otPlatDnsUpstreamQuery *query = (otPlatDnsUpstreamQuery *)user_data;
201-
202-
ctx = get_query_by_ot_transaction(query);
199+
otPlatDnsUpstreamQuery *query = ((struct query_context *)user_data)->transaction;
200+
struct query_context *ctx = get_query_by_ot_transaction(query);
203201

204202
return ctx;
205203
}

0 commit comments

Comments
 (0)