net: openthread: Handle deprecated IPv6 addresses correctly
This commit fixes an issue where deprecated IPv6 addresses were not being correctly marked. In some cases, deprecated addresses might have been used as source addresses. Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
This commit is contained in:
parent
e12602ae02
commit
fb71ca2237
1 changed files with 6 additions and 1 deletions
|
|
@ -154,6 +154,11 @@ void add_ipv6_addr_to_zephyr(struct openthread_context *context)
|
|||
|
||||
if_addr->is_mesh_local = is_mesh_local(
|
||||
context, address->mAddress.mFields.m8);
|
||||
|
||||
/* Mark address as deprecated if it is not preferred. */
|
||||
if (!address->mPreferred) {
|
||||
if_addr->addr_state = NET_ADDR_DEPRECATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,7 +200,7 @@ void add_ipv6_addr_to_ot(struct openthread_context *context,
|
|||
context, ipv6->unicast[i].address.in6_addr.s6_addr);
|
||||
|
||||
addr.mValid = true;
|
||||
addr.mPreferred = true;
|
||||
addr.mPreferred = (if_addr->addr_state == NET_ADDR_PREFERRED);
|
||||
addr.mPrefixLength = 64;
|
||||
|
||||
if (if_addr->addr_type == NET_ADDR_AUTOCONF) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue