Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

DNS inconsistency issues #85

Merged
merged 3 commits into from
Apr 17, 2019
Merged

DNS inconsistency issues #85

merged 3 commits into from
Apr 17, 2019

Conversation

keeshux
Copy link
Member

@keeshux keeshux commented Apr 16, 2019

Regression in Passepartout 1.4.0 from 1.3.0.

The recent refactoring of ConfigurationParser brought a couple issues:

  1. dnsServers defaults to [] rather than nil, but this was actually like before.

  2. However, the new code in TunnelKitProvider.bringNetworkUp(...) was affected by 1 because:

let dnsServers = cfg.sessionConfiguration.dnsServers ?? reply.options.dnsServers

didn't check for dnsServers.isEmpty. So basically, if cfg.sessionConfiguration.dnsServers was non-nil but empty, it overrode the server-pushed DNS reply.options.dnsServers.

Simple fix: default dnsServers to nil when none is set.

Thorough, backwards-compatible fix:

var dnsServers = cfg.sessionConfiguration.dnsServers
if dnsServers?.isEmpty ?? true {
    dnsServers = reply.options.dnsServers
}

@keeshux keeshux added the bug Something isn't working label Apr 16, 2019
@keeshux keeshux added this to the 1.6.2 milestone Apr 16, 2019
@keeshux keeshux self-assigned this Apr 16, 2019
@keeshux keeshux merged commit 0c3a423 into master Apr 17, 2019
@keeshux keeshux deleted the dns-inconsistency-issues branch April 17, 2019 07:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant