diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-08 17:57:50 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-08 17:57:50 +0200 |
commit | 89f658fb0f1d055b671b92e474cf9dbeb5974adf (patch) | |
tree | d4d4c642f3f13e8fa1d62f3699d44d91d0bf7fde /bpf_parser.y | |
parent | 021a7923928c27e1e4ad7d4a8c789bb77e00886f (diff) |
bpfc: also allow to load skb len into X
This functionality is available in the kernel, so make it also
available for use in bpfc.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'bpf_parser.y')
-rw-r--r-- | bpf_parser.y | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bpf_parser.y b/bpf_parser.y index 0bbc17d..19268ae 100644 --- a/bpf_parser.y +++ b/bpf_parser.y @@ -354,6 +354,8 @@ ldxi ldx : OP_LDX '#' number { set_curr_instr(BPF_LDX | BPF_IMM, 0, 0, $3); } + | OP_LDX K_PKT_LEN { + set_curr_instr(BPF_LDX | BPF_W | BPF_LEN, 0, 0, 0); } | OP_LDX 'M' '[' number ']' { set_curr_instr(BPF_LDX | BPF_MEM, 0, 0, $4); } | OP_LDXB number '*' '(' '[' number ']' '&' number ')' { |