CESNET / ipfixcol

IPFIXcol is an implementation of an IPFIX (RFC 7011) collector
Other
64 stars 37 forks source link

Forwarding storage: fixed data corruption in template sets #103

Closed ghost closed 9 years ago

ghost commented 9 years ago

The discovered bug caused all IPFIX messages with template sets to feature a data corruption at byte offset 178 from the IPFIX message header. This was caused by the following statement:

((struct ipfix_template_set *) proc.msg + prevo)->header.length = htons(proc.length);

This statement should actually be as follows:

((struct ipfix_template_set *) (proc.msg + prevo))->header.length = htons(proc.length);

I've taken the opportunity to make the code a bit simpler and easier to read.