{"record":{"id":"91c2bdb9d4ef7314","repo":"probelabs/goreplay","slug":"bpf-filter-error-q-s-interface-q","errorCode":null,"errorMessage":"BPF filter error: %q%s, interface: %q","messagePattern":"BPF filter error: %q(.+?), interface: %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/capture/capture.go","lineNumber":476,"sourceCode":"\t}\n\terr = inactive.SetTimeout(l.config.BufferTimeout)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"handle buffer timeout error: %q, interface: %q\", err, ifi.Name)\n\t}\n\thandle, err = inactive.Activate()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"PCAP Activate device error: %q, interface: %q\", err, ifi.Name)\n\t}\n\n\tbpfFilter := l.config.BPFFilter\n\tif bpfFilter == \"\" {\n\t\tbpfFilter = l.Filter(ifi)\n\t}\n\tfmt.Println(\"Interface:\", ifi.Name, \". BPF Filter:\", bpfFilter)\n\terr = handle.SetBPFFilter(bpfFilter)\n\tif err != nil {\n\t\thandle.Close()\n\t\treturn nil, fmt.Errorf(\"BPF filter error: %q%s, interface: %q\", err, bpfFilter, ifi.Name)\n\t}\n\treturn\n}\n\n// SocketHandle returns new unix ethernet handle associated with this listener settings\nfunc (l *Listener) SocketHandle(ifi pcap.Interface) (handle Socket, err error) {\n\thandle, err = NewSocket(ifi)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"sock raw error: %q, interface: %q\", err, ifi.Name)\n\t}\n\tif err = handle.SetPromiscuous(l.config.Promiscuous || l.config.Monitor); err != nil {\n\t\treturn nil, fmt.Errorf(\"promiscuous mode error: %q, interface: %q\", err, ifi.Name)\n\t}\n\tif l.config.BPFFilter == \"\" {\n\t\tl.config.BPFFilter = l.Filter(ifi)\n\t}\n\tfmt.Println(\"BPF Filter: \", l.config.BPFFilter)\n\tif err = handle.SetBPFFilter(l.config.BPFFilter); err != nil {","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/internal/capture/capture.go#L458-L494","documentation":"PcapHandle fails when SetBPFFilter rejects the BPF expression (explicit config filter or the auto-generated one); the handle is closed and the error reports the offending filter and interface so startup cannot continue with a broken capture.","triggerScenarios":"Thrown at internal/capture/capture.go:476 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the --input-raw-bpf-filter expression syntax (tcpdump accepts the same syntax)","Test the filter with tcpdump -i <iface> '<filter>' before using gor","Check the auto-generated filter isn't malformed on odd interfaces"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251e45abd242886bb64ff2b2dc98789556b56330","analyzedAt":"2026-09-02T16:44:11.369Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}