Skip to content

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

@dbardbar

Description

@dbardbar

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"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions