Skip to content

Commit 68ac22b

Browse files
authored
Merge pull request #68 from RiV-chain/RIVM-145-2
RIVM-145 IPv6 multicast fix as a regression from v0.4.7.8 when peer could not recognize other peers correctly
2 parents 23ab7e8 + b1283be commit 68ac22b

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ require gerace.dev/zipfs v0.2.0
2424

2525
require (
2626
github.com/slonm/tableprinter v0.0.0-20230107100804-643098716018
27-
github.com/vikulin/anet v0.0.6-0.20240829153812-99b8955b2cff
2827
github.com/vorot93/golang-signals v0.0.0-20170221070717-d9e83421ce45
28+
github.com/wlynxg/anet v0.0.4
2929
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15
3030
golang.zx2c4.com/wintun v0.0.0-20211104114900-415007cec224
3131
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
6868
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
6969
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
7070
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
71-
github.com/vikulin/anet v0.0.6-0.20240829153812-99b8955b2cff h1:iifW98BSWU92RJmWRcnruOihGZphu1YYBlWA0zLG7zs=
72-
github.com/vikulin/anet v0.0.6-0.20240829153812-99b8955b2cff/go.mod h1:4hyB1C384gHwcoCRaXPrCy90R0JK1AlK/a0kH+BrPyQ=
7371
github.com/vikulin/sctp v0.0.0-20221009200520-ae0f2830e422 h1:KJn6ovcNlavPTgdK2uKJoonWPP3GTb8x4FyYPIrwpZw=
7472
github.com/vikulin/sctp v0.0.0-20221009200520-ae0f2830e422/go.mod h1:wbWp47D/qXkQrDuO8qSeUXdLN9qXNZzIgLGDQIoJlJU=
7573
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
@@ -79,6 +77,8 @@ github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvV
7977
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
8078
github.com/vorot93/golang-signals v0.0.0-20170221070717-d9e83421ce45 h1:hB/hkjwf3BQnZE6Wk3SBwMJz0NqnGdwXoNzHVSYb0N0=
8179
github.com/vorot93/golang-signals v0.0.0-20170221070717-d9e83421ce45/go.mod h1:dfjQkJsG5auteUbnfLIcU72Y/z8tj7DuW9fik8f2Zn0=
80+
github.com/wlynxg/anet v0.0.4 h1:0de1OFQxnNqAu+x2FAKKCVIrnfGKQbs7FQz++tB0+Uw=
81+
github.com/wlynxg/anet v0.0.4/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
8282
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
8383
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
8484
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=

src/core/link_tcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"time"
1010

11-
"github.com/vikulin/anet"
11+
"github.com/wlynxg/anet"
1212

1313
"github.com/Arceliar/phony"
1414
)

src/multicast/multicast.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import (
99
"fmt"
1010
"net"
1111
"net/url"
12-
"strconv"
1312
"time"
1413

15-
"github.com/vikulin/anet"
14+
"github.com/wlynxg/anet"
1615

1716
"github.com/Arceliar/phony"
1817
"github.com/gologme/log"
@@ -406,11 +405,16 @@ func (m *Multicast) listen() {
406405
phony.Block(m, func() {
407406
interfaces = m._interfaces
408407
})
409-
zone, err := strconv.Atoi(from.Zone)
410-
if err != nil {
411-
continue
408+
var inter interfaceInfo
409+
var ok = false
410+
for _, info := range interfaces {
411+
if info.iface.Name == from.Zone {
412+
inter = *info
413+
ok = true
414+
}
412415
}
413-
if info, ok := interfaces[zone]; ok && info.listen {
416+
info := inter
417+
if ok && info.listen {
414418
addr.Zone = ""
415419
pin := fmt.Sprintf("/?key=%s&priority=%d", hex.EncodeToString(key), info.priority)
416420
u, err := url.Parse("tls://" + addr.String() + pin)

0 commit comments

Comments
 (0)