diff --git a/.circleci/config.yml b/.circleci/config.yml index 2bd5b03..f9cd072 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,7 @@ jobs: echo 'export CINAME=$(sh contrib/semver/name.sh)' >> $BASH_ENV echo 'export CIVERSION=$(sh contrib/semver/version.sh --bare)' >> $BASH_ENV echo 'export CIVERSIONRPM=$(sh contrib/semver/version.sh --bare | tr "-" ".")' >> $BASH_ENV + echo 'export CIBRANCH=$(echo $CIRCLE_BRANCH | tr -d "/")' >> $BASH_ENV case "$CINAME" in \ "yggdrasil") (echo 'export CICONFLICTS=yggdrasil-develop' >> $BASH_ENV) ;; \ "yggdrasil-develop") (echo 'export CICONFLICTS=yggdrasil' >> $BASH_ENV) ;; \ @@ -31,11 +32,11 @@ jobs: sudo apt-get install -y rpm file mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/RPMS ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/SRPMS - # - run: - # name: Test debug builds - # command: | - # ./build -d - # test -f yggdrasil && test -f yggdrasilctl + - run: + name: Test debug builds + command: | + ./build -d + test -f yggdrasil && test -f yggdrasilctl - run: name: Build for Linux (including Debian packages) @@ -53,9 +54,9 @@ jobs: name: Build for Linux (RPM packages) command: | git clone https://github.com/yggdrasil-network/yggdrasil-package-rpm ~/rpmbuild/SPECS - cd ../ && tar -czvf ~/rpmbuild/SOURCES/v$CIVERSIONRPM --transform "s/project/yggdrasil-go-$CIRCLE_BRANCH-$CIVERSIONRPM/" project - sed -i "s/yggdrasil-go/yggdrasil-go-$CIRCLE_BRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec - sed -i "s/^PKGNAME=yggdrasil/PKGNAME=yggdrasil-$CIRCLE_BRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec + cd ../ && tar -czvf ~/rpmbuild/SOURCES/v$CIVERSIONRPM --transform "s/project/yggdrasil-go-$CIBRANCH-$CIVERSIONRPM/" project + sed -i "s/yggdrasil-go/yggdrasil-go-$CIBRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec + sed -i "s/^PKGNAME=yggdrasil/PKGNAME=yggdrasil-$CIBRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec sed -i "s/^Name\:.*/Name\: $CINAME/" ~/rpmbuild/SPECS/yggdrasil.spec sed -i "s/^Version\:.*/Version\: $CIVERSIONRPM/" ~/rpmbuild/SPECS/yggdrasil.spec sed -i "s/^Conflicts\:.*/Conflicts\: $CICONFLICTS/" ~/rpmbuild/SPECS/yggdrasil.spec @@ -101,11 +102,11 @@ jobs: echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - run: - name: Install Go 1.12 + name: Install Go 1.12.7 command: | cd /tmp - curl -LO https://dl.google.com/go/go1.12.darwin-amd64.pkg - sudo installer -pkg /tmp/go1.12.darwin-amd64.pkg -target / + curl -LO https://dl.google.com/go/go1.12.7.darwin-amd64.pkg + sudo installer -pkg /tmp/go1.12.7.darwin-amd64.pkg -target / #- run: # name: Install Gomobile diff --git a/src/tuntap/tun_darwin.go b/src/tuntap/tun_darwin.go index 5dfca13..d7b4653 100644 --- a/src/tuntap/tun_darwin.go +++ b/src/tuntap/tun_darwin.go @@ -30,7 +30,12 @@ func (tun *TunAdapter) setup(ifname string, iftapmode bool, addr string, mtu int return tun.setupAddress(addr) } -const darwin_SIOCAIFADDR_IN6 = 2155899162 +const ( + darwin_SIOCAIFADDR_IN6 = 2155899162 // netinet6/in6_var.h + darwin_IN6_IFF_NODAD = 0x0020 // netinet6/in6_var.h + darwin_IN6_IFF_SECURED = 0x0400 // netinet6/in6_var.h + darwin_ND6_INFINITE_LIFETIME = 0xFFFFFFFF // netinet6/nd6.h +) type in6_addrlifetime struct { ia6t_expire float64 @@ -91,8 +96,11 @@ func (tun *TunAdapter) setupAddress(addr string) error { ar.ifra_addr.sin6_addr[i] = uint16(binary.BigEndian.Uint16(b)) } - ar.ifra_lifetime.ia6t_vltime = 0xFFFFFFFF - ar.ifra_lifetime.ia6t_pltime = 0xFFFFFFFF + ar.ifra_flags |= darwin_IN6_IFF_NODAD + ar.ifra_flags |= darwin_IN6_IFF_SECURED + + ar.ifra_lifetime.ia6t_vltime = darwin_ND6_INFINITE_LIFETIME + ar.ifra_lifetime.ia6t_pltime = darwin_ND6_INFINITE_LIFETIME var ir ifreq copy(ir.ifr_name[:], tun.iface.Name()) diff --git a/src/yggdrasil/search.go b/src/yggdrasil/search.go index d8c9049..4c31fd6 100644 --- a/src/yggdrasil/search.go +++ b/src/yggdrasil/search.go @@ -179,8 +179,12 @@ func (sinfo *searchInfo) continueSearch() { // Calls create search, and initializes the iterative search parts of the struct before returning it. func (s *searches) newIterSearch(dest *crypto.NodeID, mask *crypto.NodeID, callback func(*sessionInfo, error)) *searchInfo { sinfo := s.createSearch(dest, mask, callback) - sinfo.toVisit = s.core.dht.lookup(dest, true) sinfo.visited = make(map[crypto.NodeID]bool) + loc := s.core.switchTable.getLocator() + sinfo.toVisit = append(sinfo.toVisit, &dhtInfo{ + key: s.core.boxPub, + coords: loc.getCoords(), + }) // Start the search by asking ourself, useful if we're the destination return sinfo }