aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf/xdp_redirect_cpu_user.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-12-14 20:18:48 -0400
committerJason Gunthorpe <jgg@nvidia.com>2021-12-14 20:18:48 -0400
commit4922f0920966c28d674b03479cdcb7f3939bfbbd (patch)
tree6a8b3972ff853fc0addcfab662d33354124f7fdb /samples/bpf/xdp_redirect_cpu_user.c
parentRDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry (diff)
parentLinux 5.16-rc5 (diff)
downloadlinux-dev-4922f0920966c28d674b03479cdcb7f3939bfbbd.tar.xz
linux-dev-4922f0920966c28d674b03479cdcb7f3939bfbbd.zip
Merge tag 'v5.16-rc5' into rdma.git for-next
Required due to dependencies in following patches. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'samples/bpf/xdp_redirect_cpu_user.c')
-rw-r--r--samples/bpf/xdp_redirect_cpu_user.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/bpf/xdp_redirect_cpu_user.c b/samples/bpf/xdp_redirect_cpu_user.c
index d84e6949007c..a81704d3317b 100644
--- a/samples/bpf/xdp_redirect_cpu_user.c
+++ b/samples/bpf/xdp_redirect_cpu_user.c
@@ -309,7 +309,6 @@ int main(int argc, char **argv)
const char *mprog_filename = NULL, *mprog_name = NULL;
struct xdp_redirect_cpu *skel;
struct bpf_map_info info = {};
- char ifname_buf[IF_NAMESIZE];
struct bpf_cpumap_val value;
__u32 infosz = sizeof(info);
int ret = EXIT_FAIL_OPTION;
@@ -390,10 +389,10 @@ int main(int argc, char **argv)
case 'd':
if (strlen(optarg) >= IF_NAMESIZE) {
fprintf(stderr, "-d/--dev name too long\n");
+ usage(argv, long_options, __doc__, mask, true, skel->obj);
goto end_cpu;
}
- safe_strncpy(ifname_buf, optarg, strlen(ifname_buf));
- ifindex = if_nametoindex(ifname_buf);
+ ifindex = if_nametoindex(optarg);
if (!ifindex)
ifindex = strtoul(optarg, NULL, 0);
if (!ifindex) {