~imperator/public-inbox

Record interface specifier for ipv6 addresses v1 APPLIED

Stefan Tatschner: 1
 Record interface specifier for ipv6 addresses

 1 files changed, 8 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~imperator/public-inbox/patches/14193/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Record interface specifier for ipv6 addresses Export this patch

If the multicasts come from a v6 link local address, the interface
specifier needs to be stored as well. Otherwise the connection attempt
to a tracy target fails due to an invalid v6 address.
---
 searcher/discover.go | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/searcher/discover.go b/searcher/discover.go
index 0b5b2d8..12dd026 100644
--- a/searcher/discover.go
+++ b/searcher/discover.go
@@ -24,9 +24,10 @@ import (
	"encoding/json"
	"errors"
	"fmt"
	"git.sr.ht/~rumpelsepp/rlog"
	"moltce/tracy"
	"net"

	"git.sr.ht/~rumpelsepp/rlog"
)

type JsonMcast struct {
@@ -75,9 +76,11 @@ func NewSearcher(iface *net.Interface, maddr *net.UDPAddr) (*Targets, error) {
}

func (targs *Targets) listenForTargets(conn *net.UDPConn) {
	buff := make([]byte, 2048)
	oob := make([]byte, 2048)
	var target AnnouncedTarget
	var (
		target AnnouncedTarget
		buff   = make([]byte, 2048)
		oob    = make([]byte, 2048)
	)

	for {
		_, oopn, _, tempAddr, _ := conn.ReadMsgUDP(buff, oob)
@@ -108,6 +111,7 @@ func kaiserDecoder(buff []byte, dev *AnnouncedTarget, tempAddr *net.UDPAddr) err
	dev.AppName = m.Process_name
	dev.Addr.IP = tempAddr.IP
	dev.Addr.Port = int(m.Port)
	dev.Addr.Zone = tempAddr.Zone
	dev.setID()

	return nil
-- 
2.28.0