From b33045056cc338022b088fd6bc234c72b7131418 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 17 Mar 2021 14:24:13 -0400 Subject: [PATCH 1/6] update csdk to fix hosted service issue --- release-notes.md | 14 ++++++++++++++ service/build.bat | 2 +- version | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/release-notes.md b/release-notes.md index bb301c72..7ca4f7e6 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,3 +1,17 @@ +# Release 1.8.4 + +## What's New +* none + +## Other changes: +* none + +## Bugs fixed: +* Fixed a bug from the CSDK handling hosted services + +## Dependency Updates +* Tunneler SDK to v0.11.10/CSDK 0.20.22 + # Release 1.8.3 ## What's New diff --git a/service/build.bat b/service/build.bat index e8745d01..1fa7f4f0 100644 --- a/service/build.bat +++ b/service/build.bat @@ -14,7 +14,7 @@ REM See the License for the specific language governing permissions and REM limitations under the License. REM SET REPO_URL=https://github.com/openziti/ziti-tunnel-sdk-c.git -SET ZITI_TUNNEL_REPO_BRANCH=v0.11.9 +SET ZITI_TUNNEL_REPO_BRANCH=v0.11.10 REM override the c sdk used in the build - leave blank for the same as specified in the tunneler sdk SET ZITI_SDK_C_BRANCH= REM the number of TCP connections the tunneler sdk can have at any one time diff --git a/version b/version index a7ee35a3..bfa363e7 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.8.3 +1.8.4 From 0c3679535252cf1283f48d76de7c7a8dd713542d Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Wed, 17 Mar 2021 18:33:31 +0000 Subject: [PATCH 2/6] [ci skip] committing updated version related files --- DesktopEdge/Properties/AssemblyInfo.cs | 6 +++--- Installer/ZitiDesktopEdge.aip | 4 ++-- ZitiUpdateService/Properties/AssemblyInfo.cs | 6 +++--- service/ziti-tunnel/version.go | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DesktopEdge/Properties/AssemblyInfo.cs b/DesktopEdge/Properties/AssemblyInfo.cs index 95b096a5..17810880 100644 --- a/DesktopEdge/Properties/AssemblyInfo.cs +++ b/DesktopEdge/Properties/AssemblyInfo.cs @@ -50,6 +50,6 @@ using System.Windows; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyFileVersion("1.8.3.0")] +// [assembly: AssemblyVersion("1.8.4.0")] +[assembly: AssemblyVersion("1.8.4.0")] +[assembly: AssemblyFileVersion("1.8.4.0")] diff --git a/Installer/ZitiDesktopEdge.aip b/Installer/ZitiDesktopEdge.aip index df1d2283..51b13ae1 100644 --- a/Installer/ZitiDesktopEdge.aip +++ b/Installer/ZitiDesktopEdge.aip @@ -22,10 +22,10 @@ - + - + diff --git a/ZitiUpdateService/Properties/AssemblyInfo.cs b/ZitiUpdateService/Properties/AssemblyInfo.cs index 9f19430c..91298e02 100644 --- a/ZitiUpdateService/Properties/AssemblyInfo.cs +++ b/ZitiUpdateService/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyFileVersion("1.8.3.0")] +// [assembly: AssemblyVersion("1.8.4.0")] +[assembly: AssemblyVersion("1.8.4.0")] +[assembly: AssemblyFileVersion("1.8.4.0")] diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index ed46f14a..cd9c041e 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -20,9 +20,9 @@ package main const ( - Version = "1.8.3" - Revision = "1287aa42134e" + Version = "1.8.4" + Revision = "b33045056cc3" Branch = "main" BuildUser = "" - BuildDate = "2021-03-12 23:31:51" + BuildDate = "2021-03-17 18:28:07" ) From f5a2cd71336575853e03da33a3cc1dd86dd241d5 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 17 Mar 2021 22:28:08 -0400 Subject: [PATCH 3/6] initialize the ip range returned by internal dns. print warning when ip is not in the carrier grade NAT range --- service/cziti/ctun.go | 6 +----- service/cziti/sdk.go | 4 ++++ service/cziti/sdk.h | 1 + service/ziti-tunnel/service/ipc.go | 32 ++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/service/cziti/ctun.go b/service/cziti/ctun.go index c07e570d..85105a57 100644 --- a/service/cziti/ctun.go +++ b/service/cziti/ctun.go @@ -52,6 +52,7 @@ dns_manager* dns_mgr_c; int netifAddRoute(netif_handle dev, char* dest); int netifRemoveRoute(netif_handle dev, char* dest); + */ import "C" import ( @@ -134,11 +135,6 @@ func makeDriver(name string) C.netif_driver { //export netifWrite func netifWrite(_ C.netif_handle, buf unsafe.Pointer, length C.size_t) C.ssize_t { - /*t, found := devMap[C.GoString(h.id)] - if !found { - log.Panicf("An unexpected and unrecoverable error has occurred while calling netifWrite") - }*/ - b := C.GoBytes(buf, C.int(length)) theTun.writeQ <- b diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index 5e2ae32e..a690e47f 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -623,3 +623,7 @@ func getTunneledServiceAddresses(ts *C.tunneled_service_t) []dto.Address { } return values } + +func InitTunnelerDns(ipBase uint32, mask int) { + C.ziti_tunneler_init_dns(C.uint32_t(ipBase), C.int(mask)) +} diff --git a/service/cziti/sdk.h b/service/cziti/sdk.h index 18844da4..553267c7 100644 --- a/service/cziti/sdk.h +++ b/service/cziti/sdk.h @@ -85,5 +85,6 @@ void ziti_dump_go(char *msg); //void ziti_mfa_auth_request(ziti_ar_mfa_cb response_cb, ziti_context ztx, void *mfa_ctx, char *code, ziti_ar_mfa_status_cb auth_response, char *fingerprint); //void ziti_mfa_ar_cb(ziti_context ztx, void *mfa_ctx, int status); //void ziti_ar_mfa_status_cb_go(ziti_context ztx, void *mfa_ctx, int status, char *fingerprint); +int dnsFallback(const char *name, void *ctx, struct in_addr* addr); #endif /* GOLANG_SDK_H */ diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 1f55d1ee..bff3a0a5 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -20,6 +20,7 @@ package service import ( "bufio" "crypto/sha1" + "encoding/binary" "encoding/json" "fmt" "github.com/Microsoft/go-winio" @@ -260,6 +261,27 @@ func (p *Pipes) shutdownConnections() { } func initialize(cLogLevel int) error { + //TODO: this all needs to be cleaned up. it's done it two places and redundant + //TODO: fix with mfa? + ipv4 := rts.state.TunIpv4 + ipv4mask := rts.state.TunIpv4Mask + if strings.TrimSpace(ipv4) == "" { + log.Infof("ip not provided using default: %v", ipv4) + ipv4 = constants.Ipv4ip + rts.UpdateIpv4(ipv4) + } + if ipv4mask < constants.Ipv4MaxMask { + log.Warnf("provided mask is too large: %d using default: %d", ipv4mask, constants.Ipv4DefaultMask) + ipv4mask = constants.Ipv4DefaultMask + rts.UpdateIpv4Mask(ipv4mask) + } + _, ipnet, err := net.ParseCIDR(fmt.Sprintf("%s/%d", ipv4, ipv4mask)) + if err != nil { + return fmt.Errorf("error parsing CIDR block: (%v)", err) + } + dnsIpAsUint32 := binary.BigEndian.Uint32(ipnet.IP) + cziti.InitTunnelerDns(dnsIpAsUint32, len(ipnet.Mask)) + assignedIp, t, err := rts.CreateTun(rts.state.TunIpv4, rts.state.TunIpv4Mask) if err != nil { return err @@ -312,6 +334,16 @@ func setTunInfo(s *dto.TunnelStatus) { return } + carrierGradeNetworkRange := fmt.Sprintf("%s/%d", constants.Ipv4ip, 10) + _, cgsubnet, _ := net.ParseCIDR(carrierGradeNetworkRange) + + if !cgsubnet.Contains(ipnet.IP) { + log.Warnf("============================================================================") + log.Warnf("the ip provided [%s] is NOT in the expected CIDR range of %s", ipv4, carrierGradeNetworkRange) + log.Warnf("this can cause unintented consequences. Please update the ip to one in the specified range.") + log.Warnf("============================================================================") + } + t := *rts.tun mtu, err := t.MTU() if err != nil { From a8b392b52b3e804716c8d06e956f49e6d6c06fa7 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 17 Mar 2021 22:32:25 -0400 Subject: [PATCH 4/6] update readme with changes --- release-notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release-notes.md b/release-notes.md index 7ca4f7e6..9559afbb 100644 --- a/release-notes.md +++ b/release-notes.md @@ -8,6 +8,8 @@ ## Bugs fixed: * Fixed a bug from the CSDK handling hosted services +* Fixed issue intercepting connections when the configured IP is not exactly in 100.64.0.0/10 +* Print a warning when the configured IP is not in the carrier grade NAT range 100.64.0.0/10 ## Dependency Updates * Tunneler SDK to v0.11.10/CSDK 0.20.22 From 463e96a83625c2eec22770c52d1e40a7df155474 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 17 Mar 2021 23:11:08 -0400 Subject: [PATCH 5/6] update release-notes with links --- release-notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-notes.md b/release-notes.md index 9559afbb..053bcfb3 100644 --- a/release-notes.md +++ b/release-notes.md @@ -8,8 +8,8 @@ ## Bugs fixed: * Fixed a bug from the CSDK handling hosted services -* Fixed issue intercepting connections when the configured IP is not exactly in 100.64.0.0/10 -* Print a warning when the configured IP is not in the carrier grade NAT range 100.64.0.0/10 +* [#330](https://github.com/openziti/desktop-edge-win/issues/330) Fixed issue intercepting connections when the configured IP is not exactly in 100.64.0.0/10 +* [#328](https://github.com/openziti/desktop-edge-win/issues/328) Print a warning when the configured IP is not in the carrier grade NAT range 100.64.0.0/10 ## Dependency Updates * Tunneler SDK to v0.11.10/CSDK 0.20.22 From ff7133c45d39a0cb9937583e44711c6ca421ecfd Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Thu, 18 Mar 2021 15:23:33 +0000 Subject: [PATCH 6/6] [ci skip] committing updated version related files --- service/ziti-tunnel/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index cd9c041e..9a8fce7f 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -21,8 +21,8 @@ package main const ( Version = "1.8.4" - Revision = "b33045056cc3" + Revision = "01ed41ee3cf6" Branch = "main" BuildUser = "" - BuildDate = "2021-03-17 18:28:07" + BuildDate = "2021-03-18 15:18:18" )