Skip to content

Commit

Permalink
conn: use ipv6 message pool for ipv6 receiving
Browse files Browse the repository at this point in the history
Looks like a simple copy&paste error.

Fixes: 9e2f386 ("conn, device, tun: implement vectorized I/O on Linux")
Signed-off-by: Jason A. Donenfeld <[email protected]>
  • Loading branch information
zx2c4 committed Mar 24, 2023
1 parent 334b605 commit 6a07b2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conn/bind_std.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down

0 comments on commit 6a07b2a

Please sign in to comment.