Implement ECS address override feature #1168
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit implements an EDNS Client Subnet address override feature. It is controlled by two newly introduced config options
client-subnet-address-override-ipv4
andclient-subnet-address-override-ipv6
. If set, when a query is initiated by Unbound using the ECS option, the override address value specified in the config will be substituted and used instead of the original value calculated from the client's actual source address.This can be useful in certain situations where the original ECS address value doesn't make sense. E.g., it's generally not useful to send ECS queries to nameservers on the Internet using RFC 1918 subnet address values. Or it may be helpful to spoof the ECS address value to a nearby subnet if an ECS-enabled nameserver has incorrect geolocation data for the real subnet value.
This commit does not include the re-generated flex/bison output files due to the changes to the .lex/.y files. Those changes should be added as a followup if this patch is merged.