mikemiles-dev / netflow_parser

netflow_parser
Apache License 2.0
7 stars 3 forks source link

Packets generated using softflowd break the parser #58

Closed arckoor closed 4 months ago

arckoor commented 4 months ago

I have a v9 packet generated by softflowd, command line was sudo ./softflowd -v 9 -i any -n 127.0.0.1:2055 -D -T full -P udp -m 200 -t general=300s: bad_packet.pcapng.gz (Use wireshark to examine) Parsing that completely breaks the parser. During debugging I found a couple of problems:

For debugging, I added [nom(DeriveDebug)] to certain structs, and inserted the dumped impl-Blocks directly, so I could step through them in an easier way.

I hope this helps, feel free to reach out if my descriptions don't make sense :p

mikemiles-dev commented 4 months ago

Thanks for the pcap. I will look into this.

mikemiles-dev commented 4 months ago

https://github.com/mikemiles-dev/netflow_parser/pull/59

mikemiles-dev commented 4 months ago

I reworked how we are handling padding, can you retest with this branch?

arckoor commented 4 months ago

I just did, it was able to run through a roughly 2 day capture done with softflowd without a single panic. I also compared the branch to main performance wise, I didn't see any significant change (though I did just eyeball it :p). Good job and thank you very much!