summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/fdbased/packet_dispatchers.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2021-03-15 18:47:41 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-15 18:49:59 -0700
commitb1d57877264c2b94e3024375efc9914881f0bbe8 (patch)
treefcc3ee1d6ff597411847c4beacd3d8349d33178a /pkg/tcpip/link/fdbased/packet_dispatchers.go
parentec45d969236bb98a83e7da0466bd67e540c5e8b5 (diff)
Make netstack (//pkg/tcpip) buildable for 32 bit
Doing so involved breaking dependencies between //pkg/tcpip and the rest of gVisor, which are discouraged anyways. Tested on the Go branch via: gvisor.dev/gvisor/pkg/tcpip/... Addresses #1446. PiperOrigin-RevId: 363081778
Diffstat (limited to 'pkg/tcpip/link/fdbased/packet_dispatchers.go')
-rw-r--r--pkg/tcpip/link/fdbased/packet_dispatchers.go14
1 files changed, 5 insertions, 9 deletions
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)