summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/fdbased
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-03-16 01:55:27 +0000
committergVisor bot <gvisor-bot@google.com>2021-03-16 01:55:27 +0000
commit302095201997b26cef9c2b5fe28a7eb23cfdcc66 (patch)
tree4dc22840faa0b54a0ca717a6f41cb1a40f615883 /pkg/tcpip/link/fdbased
parented21cec72081f64b619dc1580b1700eb976f32d4 (diff)
parentb1d57877264c2b94e3024375efc9914881f0bbe8 (diff)
Merge release-20210309.0-27-gb1d578772 (automated)
Diffstat (limited to 'pkg/tcpip/link/fdbased')
-rw-r--r--pkg/tcpip/link/fdbased/endpoint.go2
-rw-r--r--pkg/tcpip/link/fdbased/packet_dispatchers.go14
2 files changed, 6 insertions, 10 deletions
diff --git a/pkg/tcpip/link/fdbased/endpoint.go b/pkg/tcpip/link/fdbased/endpoint.go
index e17e2085c..2bb1be5d6 100644
--- a/pkg/tcpip/link/fdbased/endpoint.go
+++ b/pkg/tcpip/link/fdbased/endpoint.go
@@ -492,7 +492,7 @@ func (e *endpoint) sendBatch(batchFD int, batch []*stack.PacketBuffer) (int, tcp
var mmsgHdr rawfile.MMsgHdr
mmsgHdr.Msg.Iov = &iovecs[0]
- mmsgHdr.Msg.Iovlen = uint64(len(iovecs))
+ mmsgHdr.Msg.SetIovlen((len(iovecs)))
mmsgHdrs = append(mmsgHdrs, mmsgHdr)
}
diff --git a/pkg/tcpip/link/fdbased/packet_dispatchers.go b/pkg/tcpip/link/fdbased/packet_dispatchers.go
index 46df87f44..a7adf822b 100644
--- a/pkg/tcpip/link/fdbased/packet_dispatchers.go
+++ b/pkg/tcpip/link/fdbased/packet_dispatchers.go
@@ -68,10 +68,8 @@ func (b *iovecBuffer) nextIovecs() []unix.Iovec {
// The kernel adds virtioNetHdr before each packet, but
// we don't use it, so so we allocate a buffer for it,
// add it in iovecs but don't add it in a view.
- b.iovecs[0] = unix.Iovec{
- Base: &vnetHdr[0],
- Len: uint64(virtioNetHdrSize),
- }
+ b.iovecs[0] = unix.Iovec{Base: &vnetHdr[0]}
+ b.iovecs[0].SetLen(virtioNetHdrSize)
vnetHdrOff++
}
for i := range b.views {
@@ -80,10 +78,8 @@ func (b *iovecBuffer) nextIovecs() []unix.Iovec {
}
v := buffer.NewView(b.sizes[i])
b.views[i] = v
- b.iovecs[i+vnetHdrOff] = unix.Iovec{
- Base: &v[0],
- Len: uint64(len(v)),
- }
+ b.iovecs[i+vnetHdrOff] = unix.Iovec{Base: &v[0]}
+ b.iovecs[i+vnetHdrOff].SetLen(len(v))
}
return b.iovecs
}
@@ -235,7 +231,7 @@ func (d *recvMMsgDispatcher) dispatch() (bool, tcpip.Error) {
iovLen := len(iovecs)
d.msgHdrs[k].Len = 0
d.msgHdrs[k].Msg.Iov = &iovecs[0]
- d.msgHdrs[k].Msg.Iovlen = uint64(iovLen)
+ d.msgHdrs[k].Msg.SetIovlen(iovLen)
}
nMsgs, err := rawfile.BlockingRecvMMsg(d.fd, d.msgHdrs)