Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fako1024 committed May 6, 2024
1 parent e9e9703 commit cb4ba29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion capture/afpacket/afring/afring_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (m *MockSource) addPacket(payload []byte, totalLen uint32, pktType, ipLayer
block := m.ringBuffer.ring[thisBlock*m.blockSize : thisBlock*m.blockSize+m.blockSize]

*(*tPacketHeaderV3Mock)(unsafe.Pointer(&block[m.curBlockPos+12])) = tPacketHeaderV3Mock{
snaplen: min(uint32(m.snapLen), uint32(len(payload))), // The snaplen is set to the totalLen if a packet is shorter
snaplen: min(uint32(m.snapLen), uint32(len(payload))), // The snaplen is set to the actual payload length if a packet is shorter
pktLen: totalLen,
pktMac: mac,
pktNet: mac + uint16(m.ipLayerOffset),
Expand Down

0 comments on commit cb4ba29

Please sign in to comment.