From be3f826fb0c0912f27dbfe13d896121d30c0c704 Mon Sep 17 00:00:00 2001 From: Johannes Kimmel Date: Sat, 26 Aug 2023 23:04:04 +0200 Subject: [PATCH] correctly calculate buffer size of ancillary data --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index cd4ec4f..4e7f1a6 100644 --- a/main.go +++ b/main.go @@ -10,10 +10,10 @@ import ( "net" "net/netip" "sync" + "syscall" "golang.org/x/net/ipv4" "golang.org/x/net/ipv6" - "golang.org/x/sys/unix" ) const ( @@ -21,7 +21,7 @@ const ( ) var ( - OOB_SIZE = unix.CmsgSpace(16 + 2) // ipv6 address + port + OOB_SIZE = syscall.CmsgSpace(syscall.SizeofInet6Pktinfo) // ipv6 address + iface index, struct in6_pktinfo ) func (vx *vx46) transform46(msgs4 []ipv4.Message, msgs6 []ipv6.Message) error {