Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 346737c0 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Support DNS64 synthesis using externally-discovered prefixes.

Currently, the DNS resolver supports DNS64 synthesis only for
prefixes that it discovered itself, and not for NAT64 prefixes
discovered via other means (e.g., RA).

Add a way to set a NAT64 prefix that was discovered by other
means. This new IPC is mutually exclusive with the existing
prefix discovery mechansisms:

- Setting the prefix has no effect if prefix discovery is
  started.
- Starting (or stopping) prefix discovery clears the prefix.
- Setting the prefix does not result in any NAT64 prefix update
  callback.

It is the responsibility of the caller (ConnectivityService,
Nat464Xlat) to ensure that prefix discovery is stopped before
setting the prefix.

This does not add any significant complexity to the connectivity
code, and it ensures that the behaviour of the existing IPCs
(startPrefix64Discovery and stopPrefix64Discovery) are unchanged.
This is necessary to ensure that DNS64 synthesis continues to
work on Q devices.

Disallowing concurrent use of prefix discovery and externally-set
prefixes also simplifies the implementation because it allows
reuse of most of the data structures and teardown code in
Dns64Configuration. The externally-set prefix is represented by a
Dns64Configuration with a special discovery ID of kNoDiscoveryId
(== 0), which cannot be used by any discovery attempt. That way,
if discovery is started, then stopped, and then the prefix is
set, if a stale discovery thread then completes, it will be
ignored because the thread's ID cannot be kNoDiscoveryId.

Bug: 153694684
Bug: 156914456
Test: new tests in resolv_integration_test
Original-Change: https://android-review.googlesource.com/1313740
Merged-In: I7c63fb62b70635a1b5cc7a21d60f091ba2705d72
Change-Id: I7c63fb62b70635a1b5cc7a21d60f091ba2705d72
parent d5389f15
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment