mirror of
https://github.com/espressif/openthread.git
synced 2026-07-11 06:40:19 +00:00
80565c58a9
This commit fetches the NAT64 prefix on infrastructure interface and advertise it to Network Data at medium preference. - Use `getaddrinfo_a()` function to asynchronously lookup the ipv6 address of the special domain `ipv4only.arpa`. The infrastructure NAT64 prefix is extracted from the domain answer. - `mInfraIfNat64PrefixStaleTimer` is scheduled to monitor the presence and change of infrastructure NAT64 prefix. - `EvaluateNat64Prefix` evaluates whether to advertise the infrastructure prefix or the local ULA prefix or neither. When there is a new infrastructure prefix, it will withdraw the legacy one and add the new one. When the infrastructure prefix no longer exists, it will withdraw the legacy one and add the local ULA prefix. When the infrastructure prefix presents again, it will add the infrastructure prefix and withdraw the local ULA prefix. New tests are added to test the scenarios when infrastructure NAT64 prefix exists. `DNS64` on OTBR is turned on to enable `bind9` with NAT64 prefix on infrastructure interface for these tests. `bind9` is explicitly turned off when testing local ULA prefix. Since bind9 is conflict with other components like dnssd, all nat64 tests are moved under /nat64 directory and configured separately. The case that two or more BRs have same infrastructure NAT64 prefix is not covered by this commit and will be followed up later.