Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json export of source and destination port aren't exported in host byte order #1608

Closed
gpfgen opened this issue Jun 22, 2022 · 0 comments · Fixed by #1614
Closed

Json export of source and destination port aren't exported in host byte order #1608

gpfgen opened this issue Jun 22, 2022 · 0 comments · Fixed by #1614
Assignees
Labels

Comments

@gpfgen
Copy link

gpfgen commented Jun 22, 2022

Exporting the flows in Json after running nDPI gives wrong source + destination ports.
The function (line 1606 in example/ndpiReader.c):

static void printFlowSerialized(u_int16_t thread_id, struct ndpi_flow_info *flow) {
..
ndpi_serialize_string_uint32(serializer, "src_port", flow->src_port);
ndpi_serialize_string_uint32(serializer, "dst_port", flow->dst_port);
..
}

should be:

static void printFlowSerialized(u_int16_t thread_id, struct ndpi_flow_info *flow) {
..
ndpi_serialize_string_uint32(serializer, "src_port", ntohs(flow->src_port));
ndpi_serialize_string_uint32(serializer, "dst_port", ntohs(flow->dst_port));
..
}

@gpfgen gpfgen added the bug label Jun 22, 2022
@utoni utoni self-assigned this Jun 24, 2022
utoni added a commit to utoni/nDPI that referenced this issue Jun 30, 2022
…tion. Fixes ntop#1608.

 * fixed possible memory leak caused by an invalid call to `node_proto_guess_walker()` during serialization
 * execute serialization code while running regression tests

Signed-off-by: Toni Uhlig <[email protected]>
utoni added a commit that referenced this issue Jul 3, 2022
…tion. Fixes #1608. (#1614)

* fixed possible memory leak caused by an invalid call to `node_proto_guess_walker()` during serialization
 * execute serialization code while running regression tests

Signed-off-by: Toni Uhlig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants