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

Detect flow pkts 6164 v3 #9062

Closed

Conversation

catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6164

Describe changes:

  • detect: adds flow.pkts_toclient keyword

OISF/suricata-verify#1267

SV_BRANCH=pr/1267

#9051 with review taken into account

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 14765

if (p->flow == NULL) {
return 0;
}
uint32_t nb = p->flow->tosrcbytecnt;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flow::tosrcbytecnt is u64

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And CI is green :-/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, that looks like a bug in clang Wimplicit-int-conversion

If I change u32 to u16, I get as expected

detect-flow-pkts.c:268:28: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint16_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
    uint16_t nb = p->flow->todstbytecnt;

But no warning with downcast from u64 to u32...

Ticket: OISF#6164

flow.pkts_toclient
flow.pkts_toserver
flow.bytes_toclient
flow.bytes_toserver
@catenacyber
Copy link
Contributor Author

Replaced by #9095

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants