From eba1382bf12df21cbd43a15ebe41e5b2a82f2561 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Mon, 3 Aug 2020 09:25:11 -0400 Subject: [PATCH] fixes issue #86 and issue #90 --- DesktopEdge/MainWindow.xaml.cs | 1 + release-notes.md | 12 ++++++++++++ service/cziti/dns.go | 15 +++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 073d7a5b..db3c9d48 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -141,6 +141,7 @@ namespace ZitiDesktopEdge { //LoadStatusFromService(s.Status); } catch /*ignored for now (Exception ex) */{ SetCantDisplay(); + serviceClient.Reconnect(); } Debug.WriteLine("App Loaded"); IdentityMenu.OnForgot += IdentityForgotten; diff --git a/release-notes.md b/release-notes.md index 6164e60b..6053a495 100644 --- a/release-notes.md +++ b/release-notes.md @@ -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 diff --git a/service/cziti/dns.go b/service/cziti/dns.go index 0eca8c90..447172c8 100644 --- a/service/cziti/dns.go +++ b/service/cziti/dns.go @@ -22,6 +22,7 @@ import ( "encoding/binary" "fmt" "net" + "strings" "sync" "sync/atomic" ) @@ -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 @@ -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 }