bitkeks / python-netflow-v9-softflowd

PyPI "netflow" package. NetFlow v9 parser, collector and analyzer implemented in Python 3. Developed and tested with softflowd
https://bitkeks.eu/blog/2016/08/collecting-netflow-v9-on-openwrt.html
MIT License
110 stars 56 forks source link

Fix V9DataFlowSet to avoid following struct.unpack error: #49

Open irino opened 7 months ago

irino commented 7 months ago

Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/python-netflow-v9-softflowd/netflow/collector.py", line 129, in run export = parse_packet(pkt.data, templates) File "/python-netflow-v9-softflowd/netflow/utils.py", line 96, in parse_packet return V9ExportPacket(data, templates["netflow"]) File "/python-netflow-v9-softflowd/netflow/v9.py", line 558, in init dfs = V9DataFlowSet(data[offset:], matched_template) File "/python-netflow-v9-softflowd/netflow/v9.py", line 231, in init unpacked_values = struct.unpack(struct_format, data[offset:offset + struct_len])