packetcap / go-pcap

Packet capture library and tools in native go
Apache License 2.0
26 stars 7 forks source link

subProtocol of filter didn't support custom ip protocol #44

Open yxhl opened 1 year ago

yxhl commented 1 year ago

I want to filte sctp protocol that protocol-numbers defined. But I can't complie it successful, the golang code didn't define it and it reject filter by ip proto 132.

Another issue that i got useless bpf when i use expression imcp.

Filter expression: &{raw:icmp lexer:{reader:0xc0000f0180} buffer:{token:18 word:icmp}}
Filter: {0 2 0 16 false }
BPF instruction:
         ldh [12]
         ret #262144
         ret #0
yxhl commented 1 year ago

The source code define sctp as stp...

yxhl commented 1 year ago

Use the protocol separately for filtering will get invalid BPF

deitch commented 1 year ago

A PR is welcome.