Commit 11b36abc authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Daniel Borkmann
Browse files

samples: bpf: user proper argument index

Use optind as index for argv instead of a hardcoded value.
When the program has options this leads to improper parameter handling.

Fixes: dc378a1a

 ("samples: bpf: get ifindex from ifname")
Signed-off-by: default avatarIoana Ciornei <>
Acked-by: default avatarMatteo Croce <>
Signed-off-by: default avatarDaniel Borkmann <>
parent e3ca63de
......@@ -103,7 +103,7 @@ int main(int argc, char **argv)
return 1;
ifindex = if_nametoindex(argv[1]);
ifindex = if_nametoindex(argv[optind]);
if (!ifindex) {
return 1;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment