diff --git a/release-notes.md b/release-notes.md index b7594464..5ead0aa1 100644 --- a/release-notes.md +++ b/release-notes.md @@ -11,6 +11,21 @@ ## Dependency Updates * +# Release 1.8.4 + +## What's New +* none + +## Other changes: +* none + +## Bugs fixed: +* Fixed a bug from the CSDK handling hosted services +* [#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 # Release 1.8.3 diff --git a/service/build.bat b/service/build.bat index fb92cb5c..8063bcee 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=mfa REM the number of TCP connections the tunneler sdk can have at any one time 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 ded357c4..a2527b40 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/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 0d1abb27..df4dfaa6 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 { diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index ed46f14a..9a8fce7f 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 = "01ed41ee3cf6" Branch = "main" BuildUser = "" - BuildDate = "2021-03-12 23:31:51" + BuildDate = "2021-03-18 15:18:18" )