cleanup code after reviewing code in PR

This commit is contained in:
ziti-ci
2020-10-28 01:09:48 -04:00
parent 11556d375b
commit fa40aeda27
3 changed files with 2 additions and 44 deletions
-6
View File
@@ -75,11 +75,6 @@ type TunIpInfo struct {
DNS string
}
type DnsConfig struct {
aIpv4 string
aIpv6 string
}
func (id *Identity) Path() string {
if id.FingerPrint == "" {
log.Fatalf("fingerprint is invalid for id %s", id.Name)
@@ -96,7 +91,6 @@ type TunnelStatus struct {
ServiceVersion ServiceVersion
TunIpv4 string
TunIpv4Mask int
DnsConfig DnsConfig
}
type ServiceVersion struct {
+1 -30
View File
@@ -235,13 +235,9 @@ func initialize() error {
if err != nil {
return err
}
setTunInfo(rts.state)
//
//ready := make(chan bool)
//go assignDns(assignedIp, ready)
//<-ready
// connect any identities that are enabled
for _, id := range rts.state.Identities {
connectIdentity(id)
}
@@ -252,31 +248,6 @@ func initialize() error {
return nil
}
func assignDns(tunIp net.IP, ready chan bool) {
log.Info("Assigning dns")
c1 := make(chan string, 1)
go func() {
time.Sleep(5 * time.Second)
c1 <- "result 1"
}()
select {
case res := <-c1:
fmt.Println(res)
case <-time.After(5 * time.Second):
fmt.Println("timeout 5")
}
cziti.DnsInit(&rts, tunIp.String(), rts.state.TunIpv4Mask)
dns := []net.IP{ tunIp }
log.Infof("DNS server - launching: %v", dns)
go cziti.RunDNSserver(dns, ready)
log.Infof("DNS server - waiting for startup")
<-ready
ready <- true
log.Infof("DNS server - ready")
cziti.Start()
}
func setTunInfo(s *dto.TunnelStatus) {
ipv4 := rts.state.TunIpv4
ipv4mask := rts.state.TunIpv4Mask
+1 -8
View File
@@ -152,17 +152,10 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int) (net.IP, error) {
log.Infof("setting TUN interface address to [%s]", ip)
err = luid.SetIPAddresses([]net.IPNet{{ip, ipnet.Mask}})
//err = luid.SetIPAddresses([]net.IPNet{{IP:ip, Mask: []byte{255,255,255,0}}})
//err = luid.SetIPAddresses([]net.IPNet{{IP:ip, Mask: []byte{255,255,255,255}}})
if err != nil {
return nil, fmt.Errorf("failed to set IP address to %v: (%v)", ip, err)
}
//dnsip := net.ParseIP("100.64.0.1")
//dnsip := ip //net.ParseIP("127.21.71.53")
//ipnet2 := net.IPNet{IP: dnsip, Mask: []byte{255,255,255,255}}
//log.Infof("meh: %v", ipnet2)
//err = luid.SetIPAddresses([]net.IPNet{ *ipnet })
dnsServers := []net.IP{ ip }
log.Infof("adding DNS servers to TUN: %s", dnsServers)