This commit is contained in:
JackDoan
2025-12-16 11:07:30 -06:00
parent 43d26d4fe5
commit e5c11e1cc2
3 changed files with 3 additions and 20 deletions

View File

@@ -297,7 +297,6 @@ func (f *Interface) listenOut(q int) {
li.ListenOut(func(pkts []*packet.Packet) {
toSend = toSend[:0]
for i := range outPackets {
outPackets[i].Valid = false
outPackets[i].SegCounter = 0
}

View File

@@ -10,11 +10,9 @@ type OutPacket struct {
SegmentPayloads [][]byte
SegmentHeaders [][]byte
SegmentIDs []uint16
//todo virtio header?
SegSize int
SegCounter int
Valid bool
wasSegmented bool
SegSize int
SegCounter int
Scratch []byte
}
@@ -35,12 +33,9 @@ func (pkt *OutPacket) Reset() {
pkt.SegmentHeaders = pkt.SegmentHeaders[:0]
pkt.SegmentIDs = pkt.SegmentIDs[:0]
pkt.SegSize = 0
pkt.Valid = false
pkt.wasSegmented = false
}
func (pkt *OutPacket) UseSegment(segID uint16, seg []byte, isV6 bool) int {
pkt.Valid = true
pkt.SegmentIDs = append(pkt.SegmentIDs, segID)
pkt.Segments = append(pkt.Segments, seg) //todo do we need this?

View File

@@ -9,7 +9,6 @@ type VirtIOPacket struct {
Header virtio.NetHdr
Chains []uint16
ChainRefs [][]byte
// OfferDescriptorChains(chains []uint16, kick bool) error
}
func NewVIO() *VirtIOPacket {
@@ -25,13 +24,3 @@ func (v *VirtIOPacket) Reset() {
v.ChainRefs = v.ChainRefs[:0]
v.Chains = v.Chains[:0]
}
type VirtIOTXPacket struct {
VirtIOPacket
}
func NewVIOTX(isV4 bool) *VirtIOTXPacket {
out := new(VirtIOTXPacket)
out.VirtIOPacket = *NewVIO()
return out
}