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

sflow packets with sample packets of non-UDP/TCP/ICMP are dropped #174

Open
dbardbar opened this issue Dec 29, 2022 · 1 comment · May be fixed by #176
Open

sflow packets with sample packets of non-UDP/TCP/ICMP are dropped #174

dbardbar opened this issue Dec 29, 2022 · 1 comment · May be fixed by #176

Comments

@dbardbar
Copy link
Contributor

A sflow packet with multiple samples, where one of the samples contains non-UDP/TCP/ICMP packet sample causes the whole sflow packet to be dropped.

A simple fix for this is to change decodeNextLayer() in network.go, so that the default case just states that all the remaining bytes are unparsed, and fills the p.L4 with an empty struct, so that the resulting JSON would have an empty L4. For example:

{"Version":5,"IPVersion":1,"AgentSubID":5,"SequenceNo":37591,"SysUpTime":3287084017,"SamplesNo":1,"Samples":[{"SequenceNo":1530345639,"SourceID":0,"SamplingRate":4096,"SamplePool":1938456576,"Drops":0,"Input":536,"Output":728,"RecordsNo":3,"Records":{"ExtRouter":{"NextHop":"115.131.251.90","SrcMask":24,"DstMask":14},"ExtSwitch":{"SrcVlan":0,"SrcPriority":0,"DstVlan":0,"DstPriority":0},"RawHeader":{"L2":{"SrcMAC":"58:00:bb:e7:57:6f","DstMAC":"f4:a7:39:44:a8:27","Vlan":0,"EtherType":2048},"L3":{"Version":4,"TOS":0,"TotalLen":1452,"ID":13515,"Flags":0,"FragOff":0,"TTL":62,"Protocol":50,"Checksum":8564,"Src":"10.1.8.5","Dst":"161.140.24.181"},"L4":{}}}],"IPAddress":"192.168.10.0"}

@dbardbar dbardbar linked a pull request Dec 29, 2022 that will close this issue
@dbardbar
Copy link
Contributor Author

Example pcap of non-TCP/UDP/ICMP traffic -
sflow_protocol_50.zip

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

Successfully merging a pull request may close this issue.

1 participant