1
0
forked from rosa/hakurei

internal/netlink: enlarge recvfrom buffer

This also uses an array type for the buffer since its size now uses the hardcoded value found in the kernel.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-03-25 17:11:57 +09:00
parent d2b635eb55
commit d62516ed1e
2 changed files with 13 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
package netlink
import (
"os"
"syscall"
"testing"
)
@@ -23,10 +22,7 @@ func checkPayload(t *testing.T, testCases []payloadTestCase) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
c := conn{
pos: syscall.NLMSG_HDRLEN,
buf: make([]byte, os.Getpagesize()),
}
c := conn{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)