Closed oortega closed 5 years ago
Hello, thanks for the report!
So, my guess is that the data[offset:offset+4]
slice does not actually hold 4 bytes, but less, indicating that the data
payload is not long enough. Reproducible through the following test cases:
# 4 bytes
>>> data = b"\x00\x01\x00\x01"
>>> struct.unpack("!HH", data)
(1, 1)
# Too many bytes
>>> data = b"\x00\x01\x00\x01\x00"
>>> struct.unpack("!HH", data)
struct.error: unpack requires a buffer of 4 bytes
# 4 bytes slice
>>> struct.unpack("!HH", data[0:4])
(1, 1)
# too short to fill slice
>>> data = b"\x00\x00\x00"
>>> struct.unpack("!HH", data[:4])
struct.error: unpack requires a buffer of 4 bytes
In this case, we'd have to investigate, why. Looking into the NetFlow TemplateFlowSet specs, the length of the fields which are iterated over are fixed at 32 bits/4 bytes.
My guess is therefore, that something is broken in transit and the packets are corrupted. If you have some sample data, we might have a chance to find the problem. This could for example be a second packet capturing file, which captures the received packets at the time the error appears.
You can optionally anonymize and shorten any uploads, since everyone with access to this issue has access to attachments.. :wink:
I was a fool, I was using version 5 of netflow instead of v9.
Hello I used the collector with 2 mikrotik routers. The router1 has little traffic, about 150 connections and it worked very well,
but the router2 has enough traffic about 11200 connections, here I had the following exception
Any idea how to increase the buffer?
Thanks.