aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/netlink/netlink_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-25 17:55:35 +0900
committerOphestra <cat@gensokyo.uk>2026-03-25 17:55:35 +0900
commit372d509e5c72775bcd44d40e31a31bbdfd6a3f00 (patch)
tree60fd7430c0ea08e5fa0282d6b95446279276e6ee /internal/netlink/netlink_test.go
parentd62516ed1ee148c58eed60c4fa38c5dc2c3b9622 (diff)
internal/netlink: expose multicast groups
This also gets rid of the cached pid value for port since that prevents multiple sockets from being open at once. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/netlink/netlink_test.go')
-rw-r--r--internal/netlink/netlink_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/netlink/netlink_test.go b/internal/netlink/netlink_test.go
index 0b7df0f1..a161ef5d 100644
--- a/internal/netlink/netlink_test.go
+++ b/internal/netlink/netlink_test.go
@@ -5,8 +5,6 @@ import (
"testing"
)
-func init() { nlPidOnce.Do(func() {}); nlPid = 1 }
-
type payloadTestCase struct {
name string
f func(c *conn)
@@ -21,8 +19,9 @@ func checkPayload(t *testing.T, testCases []payloadTestCase) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
+ t.Helper()
- c := conn{pos: syscall.NLMSG_HDRLEN}
+ c := conn{port: 1, pos: syscall.NLMSG_HDRLEN}
tc.f(&c)
if got := c.pending(); string(got) != string(tc.want) {
t.Errorf("pending: %#v, want %#v", got, tc.want)