]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
conn: use ipv6 message pool for ipv6 receiving
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 24 Mar 2023 15:20:16 +0000 (16:20 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 24 Mar 2023 15:20:16 +0000 (16:20 +0100)
Looks like a simple copy&paste error.

Fixes: 9e2f386 ("conn, device, tun: implement vectorized I/O on Linux")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
conn/bind_std.go

index 491e5710311fc444c6060b3121610ddfb0a8e24a..ab2bd85efc8069f931ec46dbc3b33e391ad64cb4 100644 (file)
@@ -243,8 +243,8 @@ func (s *StdNetBind) makeReceiveIPv4(pc *ipv4.PacketConn, conn *net.UDPConn) Rec
 
 func (s *StdNetBind) makeReceiveIPv6(pc *ipv6.PacketConn, conn *net.UDPConn) ReceiveFunc {
        return func(bufs [][]byte, sizes []int, eps []Endpoint) (n int, err error) {
-               msgs := s.ipv4MsgsPool.Get().(*[]ipv6.Message)
-               defer s.ipv4MsgsPool.Put(msgs)
+               msgs := s.ipv6MsgsPool.Get().(*[]ipv6.Message)
+               defer s.ipv6MsgsPool.Put(msgs)
                for i := range bufs {
                        (*msgs)[i].Buffers[0] = bufs[i]
                }