From 6fed2a75d749c90471da8a8f10154af3de4e1772 Mon Sep 17 00:00:00 2001 From: majestrate Date: Tue, 8 Nov 2022 17:11:22 -0500 Subject: [PATCH 01/10] Make TLS certs never expire (#977) According to RFC5280 we can make TLS certs never expire by setting their `NotAfter` date to a value that is basically the end of time. Fixes #976. --- src/core/link_tls.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/link_tls.go b/src/core/link_tls.go index 4eeb871..fbc6172 100644 --- a/src/core/link_tls.go +++ b/src/core/link_tls.go @@ -120,20 +120,18 @@ func (l *linkTLS) listen(url *url.URL, sintf string) (*Listener, error) { return entry, nil } +// RFC5280 section 4.1.2.5 +var notAfterNeverExpires = time.Date(9999, time.December, 31, 23, 59, 59, 0, time.UTC) + func (l *linkTLS) generateConfig() (*tls.Config, error) { certBuf := &bytes.Buffer{} - - // TODO: because NotAfter is finite, we should add some mechanism to - // regenerate the certificate and restart the listeners periodically - // for nodes with very high uptimes. Perhaps regenerate certs and restart - // listeners every few months or so. cert := x509.Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ CommonName: hex.EncodeToString(l.links.core.public[:]), }, NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * 365), + NotAfter: notAfterNeverExpires, KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, From 0da871f5287addb555138c65cad93183411d8d84 Mon Sep 17 00:00:00 2001 From: solanav Date: Tue, 8 Nov 2022 23:19:43 +0100 Subject: [PATCH 02/10] Fix #884 (#916) * Fixed #884 * Remove yggdrasil and yggdrasilctl * Fixed #884 Co-authored-by: asolana Co-authored-by: solanav Co-authored-by: Neil Alexander --- cmd/yggdrasil/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go index 2d1da6b..f85525d 100644 --- a/cmd/yggdrasil/main.go +++ b/cmd/yggdrasil/main.go @@ -247,7 +247,12 @@ func run(args yggArgs, ctx context.Context) { return default: // No flags were provided, therefore print the list of flags to stdout. + fmt.Println("Usage:") flag.PrintDefaults() + + if args.getaddr || args.getsnet { + fmt.Println("\nError: You need to specify some config data using -useconf or -useconffile.") + } } // Have we got a working configuration? If we don't then it probably means // that neither -autoconf, -useconf or -useconffile were set above. Stop From 7efd66932f469c2e8ff6f695995d4008ac23c158 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 12 Nov 2022 11:30:03 +0000 Subject: [PATCH 03/10] Redial failed connections if possible (#983) --- contrib/mobile/mobile.go | 5 +++ src/core/api.go | 4 +-- src/core/core.go | 7 ++++ src/core/link.go | 67 +++++++++++++++++++++++++++++++++++--- src/core/link_socks.go | 20 +++++++----- src/core/link_tcp.go | 13 +++++--- src/core/link_tls.go | 14 +++++--- src/core/link_unix.go | 10 ++++-- src/multicast/multicast.go | 12 ++++++- 9 files changed, 124 insertions(+), 28 deletions(-) diff --git a/contrib/mobile/mobile.go b/contrib/mobile/mobile.go index ff22b9d..3b3227b 100644 --- a/contrib/mobile/mobile.go +++ b/contrib/mobile/mobile.go @@ -159,6 +159,11 @@ func (m *Yggdrasil) Stop() error { return nil } +// Retry resets the peer connection timer and tries to dial them immediately. +func (m *Yggdrasil) RetryPeersNow() { + m.core.RetryPeersNow() +} + // GenerateConfigJSON generates mobile-friendly configuration in JSON format func GenerateConfigJSON() []byte { nc := defaults.GenerateConfig() diff --git a/src/core/api.go b/src/core/api.go index ae78315..5accdee 100644 --- a/src/core/api.go +++ b/src/core/api.go @@ -194,7 +194,7 @@ func (c *Core) AddPeer(uri string, sourceInterface string) error { if err != nil { return err } - info, err := c.links.call(u, sourceInterface) + info, err := c.links.call(u, sourceInterface, nil) if err != nil { return err } @@ -236,7 +236,7 @@ func (c *Core) RemovePeer(uri string, sourceInterface string) error { // This does not add the peer to the peer list, so if the connection drops, the // peer will not be called again automatically. func (c *Core) CallPeer(u *url.URL, sintf string) error { - _, err := c.links.call(u, sintf) + _, err := c.links.call(u, sintf, nil) return err } diff --git a/src/core/core.go b/src/core/core.go index 67f927a..b096d1d 100644 --- a/src/core/core.go +++ b/src/core/core.go @@ -121,6 +121,13 @@ func (c *Core) _addPeerLoop() { }) } +func (c *Core) RetryPeersNow() { + if c.addPeerTimer != nil && !c.addPeerTimer.Stop() { + <-c.addPeerTimer.C + } + c.Act(nil, c._addPeerLoop) +} + // Stop shuts down the Yggdrasil node. func (c *Core) Stop() { phony.Block(c, func() { diff --git a/src/core/link.go b/src/core/link.go index 550d7ec..fa2e332 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -34,6 +34,11 @@ type linkInfo struct { remote string // Remote name or address } +type linkDial struct { + url *url.URL + sintf string +} + type link struct { lname string links *links @@ -105,9 +110,10 @@ func (l *links) isConnectedTo(info linkInfo) bool { return isConnected } -func (l *links) call(u *url.URL, sintf string) (linkInfo, error) { - info := linkInfoFor(u.Scheme, sintf, u.Host) +func (l *links) call(u *url.URL, sintf string, errch chan<- error) (info linkInfo, err error) { + info = linkInfoFor(u.Scheme, sintf, u.Host) if l.isConnectedTo(info) { + close(errch) // already connected, no error return info, nil } options := linkOptions{ @@ -116,6 +122,7 @@ func (l *links) call(u *url.URL, sintf string) (linkInfo, error) { for _, pubkey := range u.Query()["key"] { sigPub, err := hex.DecodeString(pubkey) if err != nil { + close(errch) return info, fmt.Errorf("pinned key contains invalid hex characters") } var sigPubKey keyArray @@ -125,6 +132,7 @@ func (l *links) call(u *url.URL, sintf string) (linkInfo, error) { if p := u.Query().Get("priority"); p != "" { pi, err := strconv.ParseUint(p, 10, 8) if err != nil { + close(errch) return info, fmt.Errorf("priority invalid: %w", err) } options.priority = uint8(pi) @@ -132,15 +140,27 @@ func (l *links) call(u *url.URL, sintf string) (linkInfo, error) { switch info.linkType { case "tcp": go func() { + if errch != nil { + defer close(errch) + } if err := l.tcp.dial(u, options, sintf); err != nil && err != io.EOF { l.core.log.Warnf("Failed to dial TCP %s: %s\n", u.Host, err) + if errch != nil { + errch <- err + } } }() case "socks": go func() { + if errch != nil { + defer close(errch) + } if err := l.socks.dial(u, options); err != nil && err != io.EOF { l.core.log.Warnf("Failed to dial SOCKS %s: %s\n", u.Host, err) + if errch != nil { + errch <- err + } } }() @@ -163,19 +183,32 @@ func (l *links) call(u *url.URL, sintf string) (linkInfo, error) { } } go func() { + if errch != nil { + defer close(errch) + } if err := l.tls.dial(u, options, sintf, tlsSNI); err != nil && err != io.EOF { l.core.log.Warnf("Failed to dial TLS %s: %s\n", u.Host, err) + if errch != nil { + errch <- err + } } }() case "unix": go func() { + if errch != nil { + defer close(errch) + } if err := l.unix.dial(u, options, sintf); err != nil && err != io.EOF { l.core.log.Warnf("Failed to dial UNIX %s: %s\n", u.Host, err) + if errch != nil { + errch <- err + } } }() default: + close(errch) return info, errors.New("unknown call scheme: " + u.Scheme) } return info, nil @@ -197,7 +230,7 @@ func (l *links) listen(u *url.URL, sintf string) (*Listener, error) { return listener, err } -func (l *links) create(conn net.Conn, name string, info linkInfo, incoming, force bool, options linkOptions) error { +func (l *links) create(conn net.Conn, dial *linkDial, name string, info linkInfo, incoming, force bool, options linkOptions) error { intf := link{ conn: &linkConn{ Conn: conn, @@ -211,14 +244,14 @@ func (l *links) create(conn net.Conn, name string, info linkInfo, incoming, forc force: force, } go func() { - if err := intf.handler(); err != nil { + if err := intf.handler(dial); err != nil { l.core.log.Errorf("Link handler %s error (%s): %s", name, conn.RemoteAddr(), err) } }() return nil } -func (intf *link) handler() error { +func (intf *link) handler(dial *linkDial) error { defer intf.conn.Close() // nolint:errcheck // Don't connect to this link more than once. @@ -321,6 +354,30 @@ func (intf *link) handler() error { intf.links.core.log.Infof("Disconnected %s %s: %s, source %s; error: %s", dir, strings.ToUpper(intf.info.linkType), remoteStr, localStr, err) } + + if !intf.incoming && dial != nil { + // The connection was one that we dialled, so wait a second and try to + // dial it again. + var retry func(attempt int) + retry = func(attempt int) { + // intf.links.core.log.Infof("Retrying %s (attempt %d of 5)...", dial.url.String(), attempt) + errch := make(chan error, 1) + if _, err := intf.links.call(dial.url, dial.sintf, errch); err != nil { + return + } + if err := <-errch; err != nil { + if attempt < 3 { + time.AfterFunc(time.Second, func() { + retry(attempt + 1) + }) + } + } + } + time.AfterFunc(time.Second, func() { + retry(1) + }) + } + return nil } diff --git a/src/core/link_socks.go b/src/core/link_socks.go index 036de99..4cdffa5 100644 --- a/src/core/link_socks.go +++ b/src/core/link_socks.go @@ -37,16 +37,20 @@ func (l *linkSOCKS) dial(url *url.URL, options linkOptions) error { if err != nil { return err } - return l.handler(url.String(), info, conn, options, false) + dial := &linkDial{ + url: url, + } + return l.handler(dial, info, conn, options, false) } -func (l *linkSOCKS) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error { +func (l *linkSOCKS) handler(dial *linkDial, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error { return l.links.create( - conn, // connection - name, // connection name - info, // connection info - incoming, // not incoming - false, // not forced - options, // connection options + conn, // connection + dial, // connection URL + dial.url.String(), // connection name + info, // connection info + incoming, // not incoming + false, // not forced + options, // connection options ) } diff --git a/src/core/link_tcp.go b/src/core/link_tcp.go index 9c3c329..714ea9d 100644 --- a/src/core/link_tcp.go +++ b/src/core/link_tcp.go @@ -47,8 +47,12 @@ func (l *linkTCP) dial(url *url.URL, options linkOptions, sintf string) error { if err != nil { return err } - uri := strings.TrimRight(strings.SplitN(url.String(), "?", 2)[0], "/") - return l.handler(uri, info, conn, options, false, false) + name := strings.TrimRight(strings.SplitN(url.String(), "?", 2)[0], "/") + dial := &linkDial{ + url: url, + sintf: sintf, + } + return l.handler(dial, name, info, conn, options, false, false) } func (l *linkTCP) listen(url *url.URL, sintf string) (*Listener, error) { @@ -86,7 +90,7 @@ func (l *linkTCP) listen(url *url.URL, sintf string) (*Listener, error) { raddr := conn.RemoteAddr().(*net.TCPAddr) name := fmt.Sprintf("tcp://%s", raddr) info := linkInfoFor("tcp", sintf, tcpIDFor(laddr, raddr)) - if err = l.handler(name, info, conn, linkOptionsForListener(url), true, raddr.IP.IsLinkLocalUnicast()); err != nil { + if err = l.handler(nil, name, info, conn, linkOptionsForListener(url), true, raddr.IP.IsLinkLocalUnicast()); err != nil { l.core.log.Errorln("Failed to create inbound link:", err) } } @@ -97,9 +101,10 @@ func (l *linkTCP) listen(url *url.URL, sintf string) (*Listener, error) { return entry, nil } -func (l *linkTCP) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming, force bool) error { +func (l *linkTCP) handler(dial *linkDial, name string, info linkInfo, conn net.Conn, options linkOptions, incoming, force bool) error { return l.links.create( conn, // connection + dial, // connection URL name, // connection name info, // connection info incoming, // not incoming diff --git a/src/core/link_tls.go b/src/core/link_tls.go index fbc6172..dda0e2f 100644 --- a/src/core/link_tls.go +++ b/src/core/link_tls.go @@ -69,8 +69,12 @@ func (l *linkTLS) dial(url *url.URL, options linkOptions, sintf, sni string) err if err != nil { return err } - uri := strings.TrimRight(strings.SplitN(url.String(), "?", 2)[0], "/") - return l.handler(uri, info, conn, options, false, false) + name := strings.TrimRight(strings.SplitN(url.String(), "?", 2)[0], "/") + dial := &linkDial{ + url: url, + sintf: sintf, + } + return l.handler(dial, name, info, conn, options, false, false) } func (l *linkTLS) listen(url *url.URL, sintf string) (*Listener, error) { @@ -109,7 +113,7 @@ func (l *linkTLS) listen(url *url.URL, sintf string) (*Listener, error) { raddr := conn.RemoteAddr().(*net.TCPAddr) name := fmt.Sprintf("tls://%s", raddr) info := linkInfoFor("tls", sintf, tcpIDFor(laddr, raddr)) - if err = l.handler(name, info, conn, linkOptionsForListener(url), true, raddr.IP.IsLinkLocalUnicast()); err != nil { + if err = l.handler(nil, name, info, conn, linkOptionsForListener(url), true, raddr.IP.IsLinkLocalUnicast()); err != nil { l.core.log.Errorln("Failed to create inbound link:", err) } } @@ -165,6 +169,6 @@ func (l *linkTLS) generateConfig() (*tls.Config, error) { }, nil } -func (l *linkTLS) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming, force bool) error { - return l.tcp.handler(name, info, conn, options, incoming, force) +func (l *linkTLS) handler(dial *linkDial, name string, info linkInfo, conn net.Conn, options linkOptions, incoming, force bool) error { + return l.tcp.handler(dial, name, info, conn, options, incoming, force) } diff --git a/src/core/link_unix.go b/src/core/link_unix.go index 50183a2..7f78257 100644 --- a/src/core/link_unix.go +++ b/src/core/link_unix.go @@ -45,7 +45,10 @@ func (l *linkUNIX) dial(url *url.URL, options linkOptions, _ string) error { if err != nil { return err } - return l.handler(url.String(), info, conn, options, false) + dial := &linkDial{ + url: url, + } + return l.handler(dial, url.String(), info, conn, options, false) } func (l *linkUNIX) listen(url *url.URL, _ string) (*Listener, error) { @@ -74,7 +77,7 @@ func (l *linkUNIX) listen(url *url.URL, _ string) (*Listener, error) { break } info := linkInfoFor("unix", "", url.String()) - if err = l.handler(url.String(), info, conn, linkOptionsForListener(url), true); err != nil { + if err = l.handler(nil, url.String(), info, conn, linkOptionsForListener(url), true); err != nil { l.core.log.Errorln("Failed to create inbound link:", err) } } @@ -85,9 +88,10 @@ func (l *linkUNIX) listen(url *url.URL, _ string) (*Listener, error) { return entry, nil } -func (l *linkUNIX) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error { +func (l *linkUNIX) handler(dial *linkDial, name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error { return l.links.create( conn, // connection + dial, // connection URL name, // connection name info, // connection info incoming, // not incoming diff --git a/src/multicast/multicast.go b/src/multicast/multicast.go index 8d7fbb7..ec14523 100644 --- a/src/multicast/multicast.go +++ b/src/multicast/multicast.go @@ -30,6 +30,7 @@ type Multicast struct { _isOpen bool _listeners map[string]*listenerInfo _interfaces map[string]*interfaceInfo + _timer *time.Timer config struct { _groupAddr GroupAddress _interfaces map[MulticastInterface]struct{} @@ -207,6 +208,15 @@ func (m *Multicast) _getAllowedInterfaces() map[string]*interfaceInfo { return interfaces } +func (m *Multicast) AnnounceNow() { + phony.Block(m, func() { + if m._timer != nil && !m._timer.Stop() { + <-m._timer.C + } + m.Act(nil, m._announce) + }) +} + func (m *Multicast) _announce() { if !m._isOpen { return @@ -329,7 +339,7 @@ func (m *Multicast) _announce() { break } } - time.AfterFunc(time.Second, func() { + m._timer = time.AfterFunc(time.Second, func() { m.Act(nil, m._announce) }) } From e824c73e21bd06756189765ee5e39532a82a2a16 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 12 Nov 2022 11:56:50 +0000 Subject: [PATCH 04/10] Fix crash --- src/core/link.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/core/link.go b/src/core/link.go index fa2e332..933e398 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -113,7 +113,9 @@ func (l *links) isConnectedTo(info linkInfo) bool { func (l *links) call(u *url.URL, sintf string, errch chan<- error) (info linkInfo, err error) { info = linkInfoFor(u.Scheme, sintf, u.Host) if l.isConnectedTo(info) { - close(errch) // already connected, no error + if errch != nil { + close(errch) // already connected, no error + } return info, nil } options := linkOptions{ @@ -122,7 +124,9 @@ func (l *links) call(u *url.URL, sintf string, errch chan<- error) (info linkInf for _, pubkey := range u.Query()["key"] { sigPub, err := hex.DecodeString(pubkey) if err != nil { - close(errch) + if errch != nil { + close(errch) + } return info, fmt.Errorf("pinned key contains invalid hex characters") } var sigPubKey keyArray @@ -132,7 +136,9 @@ func (l *links) call(u *url.URL, sintf string, errch chan<- error) (info linkInf if p := u.Query().Get("priority"); p != "" { pi, err := strconv.ParseUint(p, 10, 8) if err != nil { - close(errch) + if errch != nil { + close(errch) + } return info, fmt.Errorf("priority invalid: %w", err) } options.priority = uint8(pi) @@ -208,7 +214,9 @@ func (l *links) call(u *url.URL, sintf string, errch chan<- error) (info linkInf }() default: - close(errch) + if errch != nil { + close(errch) + } return info, errors.New("unknown call scheme: " + u.Scheme) } return info, nil From 9df3bc0066d626d43d66588c70d14999e58f2d79 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 12 Nov 2022 15:26:43 +0000 Subject: [PATCH 05/10] Update to Arceliar/ironwood@846a97f5e5bb7b4002638c1c33790707a7060e8f --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index adaf7cf..7c7da09 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yggdrasil-network/yggdrasil-go go 1.17 require ( - github.com/Arceliar/ironwood v0.0.0-20221025225125-45b4281814c2 + github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 github.com/cheggaaa/pb/v3 v3.0.8 github.com/gologme/log v1.2.0 @@ -12,7 +12,7 @@ require ( github.com/kardianos/minwinsvc v1.0.2 github.com/mitchellh/mapstructure v1.4.1 github.com/vishvananda/netlink v1.1.0 - golang.org/x/mobile v0.0.0-20221020085226-b36e6246172e + golang.org/x/mobile v0.0.0-20221110043201-43a038452099 golang.org/x/net v0.0.0-20221014081412-f15817d10f9b golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 golang.org/x/text v0.3.8 diff --git a/go.sum b/go.sum index e398aca..69558e3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Arceliar/ironwood v0.0.0-20221025225125-45b4281814c2 h1:Usab30pNT2i/vZvpXcN9uOr5IO1RZPcUqoGH0DIAPnU= -github.com/Arceliar/ironwood v0.0.0-20221025225125-45b4281814c2/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= +github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb h1:O/+9TuKlOuaVagYOApNdOgf+PUbgM+mZ+bpo0L0wddM= +github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 h1:WndgpSW13S32VLQ3ugUxx2EnnWmgba1kCqPkd4Gk1yQ= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979/go.mod h1:6Lkn+/zJilRMsKmbmG1RPoamiArC6HS73xbwRyp3UyI= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -55,8 +55,8 @@ golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9t golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20221020085226-b36e6246172e h1:zSgtO19fpg781xknwqiQPmOHaASr6E7ZVlTseLd9Fx4= -golang.org/x/mobile v0.0.0-20221020085226-b36e6246172e/go.mod h1:aAjjkJNdrh3PMckS4B10TGS2nag27cbKR1y2BpUxsiY= +golang.org/x/mobile v0.0.0-20221110043201-43a038452099 h1:aIu0lKmfdgtn2uTj7JI2oN4TUrQvgB+wzTPO23bCKt8= +golang.org/x/mobile v0.0.0-20221110043201-43a038452099/go.mod h1:aAjjkJNdrh3PMckS4B10TGS2nag27cbKR1y2BpUxsiY= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= From cba667f28da202ec1d1bbbe24d98b50eb0680afe Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 12 Nov 2022 16:47:20 +0000 Subject: [PATCH 06/10] Fix race conditions (update to Arceliar/ironwood@2c0740b) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7c7da09..a851736 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yggdrasil-network/yggdrasil-go go 1.17 require ( - github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb + github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 github.com/cheggaaa/pb/v3 v3.0.8 github.com/gologme/log v1.2.0 diff --git a/go.sum b/go.sum index 69558e3..04819a6 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb h1:O/+9TuKlOuaVagYOApNdOgf+PUbgM+mZ+bpo0L0wddM= -github.com/Arceliar/ironwood v0.0.0-20221112140720-846a97f5e5bb/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= +github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca h1:tWBRn22W6q4aEb+jPUZZ3vaJjZGbJ/6ON6QVmzJFRlE= +github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 h1:WndgpSW13S32VLQ3ugUxx2EnnWmgba1kCqPkd4Gk1yQ= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979/go.mod h1:6Lkn+/zJilRMsKmbmG1RPoamiArC6HS73xbwRyp3UyI= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= From ae24f5de38885bc17adb63f5726459beb3fcaa1c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 12 Nov 2022 16:55:23 +0000 Subject: [PATCH 07/10] Less aggressive key ratcheting (update to Arceliar/ironwood@bf5f12a) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a851736..74b88aa 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yggdrasil-network/yggdrasil-go go 1.17 require ( - github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca + github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26 github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 github.com/cheggaaa/pb/v3 v3.0.8 github.com/gologme/log v1.2.0 diff --git a/go.sum b/go.sum index 04819a6..f3904fc 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca h1:tWBRn22W6q4aEb+jPUZZ3vaJjZGbJ/6ON6QVmzJFRlE= -github.com/Arceliar/ironwood v0.0.0-20221112164410-2c0740b8ceca/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= +github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26 h1:RJIZ+FIOx4v3SYaR236RwmBOyK6FJNA/+6Sq1CCf9M4= +github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 h1:WndgpSW13S32VLQ3ugUxx2EnnWmgba1kCqPkd4Gk1yQ= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979/go.mod h1:6Lkn+/zJilRMsKmbmG1RPoamiArC6HS73xbwRyp3UyI= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= From 596f16aa6cf8e2cba07747ea2971c3ed4973caf8 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 15 Nov 2022 12:46:08 +0000 Subject: [PATCH 08/10] Reduce allocations in `encrypted` package (update to Arceliar/ironwood@ec61cea) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 74b88aa..7d6b3bd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yggdrasil-network/yggdrasil-go go 1.17 require ( - github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26 + github.com/Arceliar/ironwood v0.0.0-20221115123222-ec61cea2f439 github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 github.com/cheggaaa/pb/v3 v3.0.8 github.com/gologme/log v1.2.0 diff --git a/go.sum b/go.sum index f3904fc..3c2f731 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26 h1:RJIZ+FIOx4v3SYaR236RwmBOyK6FJNA/+6Sq1CCf9M4= -github.com/Arceliar/ironwood v0.0.0-20221112165445-bf5f12ab2b26/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= +github.com/Arceliar/ironwood v0.0.0-20221115123222-ec61cea2f439 h1:eOW6/XIs06TnUn9GPCnfv71CQZw8edP3u3mH3lZt6iM= +github.com/Arceliar/ironwood v0.0.0-20221115123222-ec61cea2f439/go.mod h1:RP72rucOFm5udrnEzTmIWLRVGQiV/fSUAQXJ0RST/nk= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979 h1:WndgpSW13S32VLQ3ugUxx2EnnWmgba1kCqPkd4Gk1yQ= github.com/Arceliar/phony v0.0.0-20210209235338-dde1a8dca979/go.mod h1:6Lkn+/zJilRMsKmbmG1RPoamiArC6HS73xbwRyp3UyI= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= From 48d278bd2a24021ff1ea3a990984b6a4d4ddaab7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 15 Nov 2022 19:06:14 +0000 Subject: [PATCH 09/10] Version 0.4.7 changelog (#985) --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af827b2..9a144c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - in case of vulnerabilities. --> +## [0.4.7] - 2022-11-19 + +### Added + +- Dropped outbound peerings will now try to reconnect after a single second, rather than waiting up to 60 seconds for the normal peer timer + +### Changed + +- Session encryption keys are now rotated at most once per minute, which reduces CPU usage and improves throughput on fast low latency links +- Buffers are now reused in the session encryption handler, which improves session throughput and reduces memory allocations +- Buffers are now reused in the router for DHT and path traffic, which improves overall routing throughput and reduces memory allocations + +### Fixed + +- A bug in the admin socket where requests fail unless `arguments` is specified has been fixed +- Certificates on TLS listeners will no longer expire after a year +- The `-address` and `-subnet` command line options now return a useful warning when no configuration is specified + ## [0.4.6] - 2022-10-25 ### Added From b0f6544b079240c17157072dd3d3dc8d5400a0a4 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 20 Nov 2022 21:14:33 +0000 Subject: [PATCH 10/10] Update changelog date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a144c1..2a43a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - in case of vulnerabilities. --> -## [0.4.7] - 2022-11-19 +## [0.4.7] - 2022-11-20 ### Added