mirror of
https://github.com/soypat/lneto.git
synced 2026-09-02 12:59:04 +00:00
Ignoring packet padding for IPv4 capture (#21)
This commit is contained in:
@@ -195,6 +195,8 @@ func (pc *PacketBreakdown) CaptureIPv4(dst []Frame, pkt []byte, bitOffset int) (
|
||||
if pc.validator().HasError() {
|
||||
return dst, pc.validator().ErrPop()
|
||||
}
|
||||
// limit packet to the actual IPv4 frame size
|
||||
pkt = pkt[:bitOffset/8+int(ifrm4.TotalLength())]
|
||||
finfo := Frame{
|
||||
Protocol: ethernet.TypeIPv4,
|
||||
PacketBitOffset: bitOffset,
|
||||
|
||||
Reference in New Issue
Block a user