inputs.netflow:
TCP flags are not decoded properly when using sFlow v5 decoder if more that one flag is present
#16247
Labels
bug
unexpected problem or unintended behavior
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf v1.32.3 running on Docker, Debian 12 as base OS
Docker
docker-compose example:
Steps to reproduce
Steps described in issue #15918 (comment) are valid.
Expected behavior
Decoder must be able to detect multiple enabled TCP flags and generate the correct string for
tcp_flags
field.Actual behavior
In TCP headers, multiple flags can be checked at the same time. Current code does not support multiple flags due to the behavior of switch statements in Golang (no automatic fallthrough):
telegraf/plugins/inputs/netflow/sflow_v5.go
Lines 420 to 439 in 2636612
For example, if a packet contains SYN and ACK flags, only SYN would be included because is the first matching case in the switch.
Additional info
I will open a PR as soon as I can to fix this issue.
The text was updated successfully, but these errors were encountered: