OSDN Git Service

netdevsim: allow program sharing between devices
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 17 Jul 2018 17:53:27 +0000 (10:53 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 18 Jul 2018 13:10:34 +0000 (15:10 +0200)
Allow program sharing between devices which were linked together.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/netdevsim/bpf.c

index 9eab29f..8144420 100644 (file)
@@ -294,7 +294,7 @@ nsim_setup_prog_hw_checks(struct netdevsim *ns, struct netdev_bpf *bpf)
                NSIM_EA(bpf->extack, "xdpoffload of non-bound program");
                return -EINVAL;
        }
-       if (bpf->prog->aux->offload->netdev != ns->netdev) {
+       if (!bpf_offload_dev_match(bpf->prog, ns->netdev)) {
                NSIM_EA(bpf->extack, "program bound to different dev");
                return -EINVAL;
        }