Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: openthread: Fix the handling of address state changes #77210

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions subsys/net/l2/openthread/openthread_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static bool is_mesh_local(struct openthread_context *context,
const otMeshLocalPrefix *ml_prefix =
otThreadGetMeshLocalPrefix(context->instance);

return (memcmp(address, ml_prefix->m8, sizeof(ml_prefix)) == 0);
return (memcmp(address, ml_prefix->m8, sizeof(ml_prefix->m8)) == 0);
}

int pkt_list_add(struct openthread_context *context, struct net_pkt *pkt)
Expand Down Expand Up @@ -156,9 +156,8 @@ void add_ipv6_addr_to_zephyr(struct openthread_context *context)
context, address->mAddress.mFields.m8);

/* Mark address as deprecated if it is not preferred. */
if (!address->mPreferred) {
if_addr->addr_state = NET_ADDR_DEPRECATED;
}
if_addr->addr_state =
address->mPreferred ? NET_ADDR_PREFERRED : NET_ADDR_DEPRECATED;
}
}

Expand Down
Loading