diff options
| -rw-r--r-- | net/core/dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 09525a27319c..5e2ba133fba7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -7143,6 +7143,13 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, | |||
| 7143 | bpf_op == ops->ndo_bpf); | 7143 | bpf_op == ops->ndo_bpf); |
| 7144 | if (IS_ERR(prog)) | 7144 | if (IS_ERR(prog)) |
| 7145 | return PTR_ERR(prog); | 7145 | return PTR_ERR(prog); |
| 7146 | |||
| 7147 | if (!(flags & XDP_FLAGS_HW_MODE) && | ||
| 7148 | bpf_prog_is_dev_bound(prog->aux)) { | ||
| 7149 | NL_SET_ERR_MSG(extack, "using device-bound program without HW_MODE flag is not supported"); | ||
| 7150 | bpf_prog_put(prog); | ||
| 7151 | return -EINVAL; | ||
| 7152 | } | ||
| 7146 | } | 7153 | } |
| 7147 | 7154 | ||
| 7148 | err = dev_xdp_install(dev, bpf_op, extack, flags, prog); | 7155 | err = dev_xdp_install(dev, bpf_op, extack, flags, prog); |
