Skip to content

Commit

Permalink
fixes issue #86 and issue #90
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Aug 3, 2020
1 parent 791d962 commit eba1382
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions DesktopEdge/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e) {
//LoadStatusFromService(s.Status);
} catch /*ignored for now (Exception ex) */{
SetCantDisplay();
serviceClient.Reconnect();
}
Debug.WriteLine("App Loaded");
IdentityMenu.OnForgot += IdentityForgotten;
Expand Down
12 changes: 12 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Release 0.0.19

* What's New

* Nothing yet

* Bug fixes

* [#82](https://github.com/openziti/desktop-edge-win/issues/82) - MTU was no longer sent to UI correctly
* [#86](https://github.com/openziti/desktop-edge-win/issues/86) - Inconsistent treatment of DNS requests - all requests will be treated as absolute going forward
* [#90](https://github.com/openziti/desktop-edge-win/issues/90) - UI will not reconnect to service if started before service

# Release 0.0.18

* What's New
Expand Down
15 changes: 13 additions & 2 deletions service/cziti/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"encoding/binary"
"fmt"
"net"
"strings"
"sync"
"sync/atomic"
)
Expand Down Expand Up @@ -65,12 +66,21 @@ type ctxService struct {
count int
}

func normalizeDnsName(dnsName string) string {
if strings.HasSuffix(dnsName, ".") {
return dnsName
} else {
// append a period to the dnsName - forcing it to be a FQDN
return dnsName + "."
}
}

// RegisterService will return the next ip address in the configured range. If the ip address is not
// assigned to a hostname an error will also be returned indicating why.
func (dns *dnsImpl) RegisterService(svcId string, dnsNameToReg string, port uint16, ctx *CZitiCtx, name string) (net.IP, error) {
log.Infof("adding DNS entry for service name %s@%s:%d", name, dnsNameToReg, port)
DnsInit(defaultCidr, defaultMaskBits)
dnsName := dnsNameToReg + "."
dnsName := normalizeDnsName(dnsNameToReg)
key := fmt.Sprint(dnsName, ':', port)

var ip net.IP
Expand Down Expand Up @@ -126,7 +136,8 @@ func (dns *dnsImpl) RegisterService(svcId string, dnsNameToReg string, port uint
return ip, nil
}

func (dns *dnsImpl) Resolve(dnsName string) net.IP {
func (dns *dnsImpl) Resolve(toResolve string) net.IP {
dnsName := normalizeDnsName(toResolve)
return dns.hostnameMap[dnsName].ip
}

Expand Down

0 comments on commit eba1382

Please sign in to comment.