diff --git a/src/yggdrasil/link.go b/src/yggdrasil/link.go index aff4054..3d06fbf 100644 --- a/src/yggdrasil/link.go +++ b/src/yggdrasil/link.go @@ -185,13 +185,17 @@ func (intf *link) handler() (chan struct{}, error) { return nil, err } meta = version_metadata{} - if !meta.decode(metaBytes) || !meta.check() { + base := version_getBaseMetadata() + if !meta.decode(metaBytes) { return nil, errors.New("failed to decode metadata") } - base := version_getBaseMetadata() - if meta.ver > base.ver || meta.ver == base.ver && meta.minorVer > base.minorVer { - intf.links.core.log.Errorln("Failed to connect to node: " + intf.lname + " version: " + fmt.Sprintf("%d.%d", meta.ver, meta.minorVer)) - return nil, errors.New("failed to connect: wrong version") + if !meta.check() { + intf.links.core.log.Errorf("Failed to connect to node: %s is incompatible version (local %s, remote %s)", + intf.lname, + fmt.Sprintf("%d.%d", base.ver, base.minorVer), + fmt.Sprintf("%d.%d", meta.ver, meta.minorVer), + ) + return nil, errors.New("remote node is incompatible version") } // Check if the remote side matches the keys we expected. This is a bit of a weak // check - in future versions we really should check a signature or something like that. diff --git a/src/yggdrasil/version.go b/src/yggdrasil/version.go index e653e92..ad334c8 100644 --- a/src/yggdrasil/version.go +++ b/src/yggdrasil/version.go @@ -22,7 +22,7 @@ func version_getBaseMetadata() version_metadata { return version_metadata{ meta: [4]byte{'m', 'e', 't', 'a'}, ver: 0, - minorVer: 1, + minorVer: 3, } }