fix(connlib): always update TunConfig on any changes
#8453
Merged
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.
Currently, we are only emitting updates to the
TunConfigwhen the routes or the DNS servers change. This isn't correct, we should also emit updates for it when the IPs or the search-domain changes.In order to achieve that, we create a new
TunConfigbased on the existing one every time we receive anInterfaceConfigupdate. Depending on our current state, we may create an entirely newTunConfigor create a new one where we copy the fields in from the newInterfaceConfig. We then unconditionally callmaybe_update_tun_configwhich does the necessary work to only emit updates when things actually changed.To ensure this works in all cases and the latest update is always reflected on the TUN device, we also extend the proptests to assert the latest search domain.
Fixes: #8451