回复 7# Tinnal
我那个bpf过滤没有问题
struct bpf_insn insns[] = {
52. BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 12),
59. BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_IP, 0, 10),
60. BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 23),
61. BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_TCP, 0, ,
62. BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 20),
63. BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 6, 0),
64. BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 14),
65. BPF_STMT(BPF_LD+BPF_H+BPF_IND, 14),
66. BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 2, 0),
67. BPF_STMT(BPF_LD+BPF_H+BPF_IND, 16),
68. BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 79, 0, 1),
69. BPF_STMT(BPF_RET+BPF_K, (u_int)-1),
70. BPF_STMT(BPF_RET+BPF_K, 0),
71.};
|