Skip to content

Commit

Permalink
fix internal port redirect
Browse files Browse the repository at this point in the history
- handles #105. corectld now respects all sorts of custom host pf
  settings

Signed-off-by: António Meireles <[email protected]>
  • Loading branch information
AntonioMeireles committed Dec 1, 2016
1 parent 6f074a1 commit bc54447
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 85 deletions.
6 changes: 4 additions & 2 deletions components/server/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (dns *DNSServer) PortForward() (err error) {
session.Caller.Network.Address, EmbeddedDNSport)
pfR.Close()
exec.Command("/sbin/pfctl", "-e").Run()
return exec.Command("/sbin/pfctl", "-f", pfC.Name()).Run()
return exec.Command("/sbin/pfctl", "-a", "com.apple/corectl-dns-forwarding",
"-f", pfC.Name()).Run()
}

func (dns *DNSServer) Start() {
Expand Down Expand Up @@ -169,7 +170,8 @@ type runner interface {
}

func teardownService() {
exec.Command("/sbin/pfctl", "-f", "/etc/pf.conf").Run()
exec.Command("/sbin/pfctl", "-a", "com.apple/corectl-dns-forwarding",
"-Fa").Run()
Daemon.DNSServer.rmRecord("corectld", session.Caller.Network.Address)
os.Remove("/etc/resolver/corectld")
}
Expand Down
83 changes: 0 additions & 83 deletions components/server/vpn.go

This file was deleted.

0 comments on commit bc54447

Please sign in to comment.