pcap.Handle.SetBPFInstructionFilter exit abnormally on windows
- Dominant language
- Go
- Stars
- 6.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
OS: windows 10 with npcap 1.73, go version 1.20.2
pcap.Handle.SetBPFInstructionFilter exit abnormally, even with single instruction, tried with gopacket 1.1.19 and latest commit
reproduce with following code:
```
package main
import (
"fmt"
"github.com/google/gopacket/pcap"
)
func main() {
ifs, err := pcap.FindAllDevs()
if err != nil {
panic(err)
}
h, err := pcap.OpenLive(ifs[0].Name, 9000, true, pcap.BlockForever)
if err != nil {
panic(err)
}
bpfList := []pcap.BPFInstruction{
// {0x28, 0, 0, 0x0000000c},
// {0x15, 0, 9, 0x00000800},
// {0x30, 0, 0, 0x00000017},
// {0x15, 0, 7, 0x00000006},
// {0x28, 0, 0, 0x00000014},
// {0x45, 5, 0, 0x00001fff},
// {0xb1, 0, 0, 0x0000000e},
// {0x50, 0, 0, 0x0000001b},
// {0x54, 0, 0, 0x00000012},
// {0x15, 0, 1, 0x00000012},
// {0x6, 0, 0, 0x0000ffff},
{0x6, 0, 0, 0x00000000},
}
err = h.SetBPFInstructionFilter(bpfList)
fmt.Println(err)
}
```
run on windows, got following result:
```
exit status 0xc0000374
```
Contributor guide
Assessment
This issue has not been assessed yet.