Skip to content

Commit 830d5ee

Browse files
committed
NetFlow converter: resolve some TODOs
1 parent e2769f1 commit 830d5ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core/netflow2ipfix/netflow9.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ conv_mem_reserve(ipx_nf9_conv_t *conv, size_t size)
302302
new_alloc /= 1024U;
303303
new_alloc += 1U;
304304
new_alloc *= 1024U;
305-
// TODO: during TEST allocate only to required size and use valgrind
306305
uint8_t *new_msg = realloc(conv->data.ipx_msg, new_alloc * sizeof(uint8_t));
307306
if (!new_msg) {
308307
return IPX_ERR_NOMEM;
@@ -1106,7 +1105,7 @@ conv_process_msg(ipx_nf9_conv_t *conv, const struct ipx_nf9_msg_hdr *nf9_msg, ui
11061105
* be also part of the message and we need to change their template definition (i.e. add
11071106
* Enterprise Numbers).
11081107
*/
1109-
size_t new_size = (size_t) nf9_size + (8U * ntohs(nf9_msg->count)); // TODO: try only header size during tests...
1108+
size_t new_size = (size_t) nf9_size + (8U * ntohs(nf9_msg->count));
11101109
if (conv_mem_reserve(conv, new_size) != IPX_OK) {
11111110
CONV_ERROR(conv, "A memory allocation failed (%s:%d).", __FILE__, __LINE__);
11121111
return IPX_ERR_NOMEM;
@@ -1131,7 +1130,7 @@ conv_process_msg(ipx_nf9_conv_t *conv, const struct ipx_nf9_msg_hdr *nf9_msg, ui
11311130
// (Options) Template FlowSet
11321131
rc_conv = conv_process_tset(conv, it.set);
11331132
} else {
1134-
// Unknown FlowSet ID // TODO: skip unknown
1133+
// Unknown FlowSet ID -> skip
11351134
CONV_INFO(conv, "Ignoring FlowSet with unsupported ID %" PRIu16, flowset_id);
11361135
rc_conv = IPX_OK;
11371136
}

0 commit comments

Comments
 (0)