Skip to content

Commit fb497f5

Browse files
committed
Export RejectAllExpr const
1 parent 6489887 commit fb497f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compile.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const (
2222
MaxBpfInstructions = 4096
2323
bpfInstructionBufferSize = 8 * MaxBpfInstructions
2424
MAXIMUM_SNAPLEN = 262144
25+
26+
RejectAllExpr = "__reject_all__"
2527
)
2628

2729
type StackOffset int
@@ -43,7 +45,7 @@ Steps:
4345
3. [!DirectRead] Convert direct memory load to bpf_probe_read_kernel call
4446
*/
4547
func CompileEbpf(expr string, opts Options) (insts asm.Instructions, err error) {
46-
if expr == "__reject_all__" {
48+
if expr == RejectAllExpr {
4749
return asm.Instructions{
4850
asm.Mov.Reg(asm.R4, asm.R5), // r4 = r5 (data = data_end)
4951
}, nil

0 commit comments

Comments
 (0)