diff options
author | John Fastabend <john.fastabend@gmail.com> | 2017-07-17 09:29:18 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-17 09:48:06 -0700 |
commit | 97f91a7cf04ff605845c20948b8a80e54cbd3376 (patch) | |
tree | 0d5c2872667d06e7e2a7f83253505c5170a0258b /kernel/bpf/verifier.c | |
parent | 546ac1ffb70d25b56c1126940e5ec639c4dd7413 (diff) | |
download | blackbird-obmc-linux-97f91a7cf04ff605845c20948b8a80e54cbd3376.tar.gz blackbird-obmc-linux-97f91a7cf04ff605845c20948b8a80e54cbd3376.zip |
bpf: add bpf_redirect_map helper routine
BPF programs can use the devmap with a bpf_redirect_map() helper
routine to forward packets to netdevice in map.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 4016774d5cca..df05d65f0c87 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1312,6 +1312,10 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id) if (map->map_type != BPF_MAP_TYPE_CGROUP_ARRAY) goto error; break; + case BPF_FUNC_redirect_map: + if (map->map_type != BPF_MAP_TYPE_DEVMAP) + goto error; + break; default: break; } |