diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2018-05-14 04:29:15 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-14 17:41:59 -0400 |
commit | 53ea24c20cea32b1dc70673402b496c4a5291d2d (patch) | |
tree | 07298680244a2c50bf57d51f58bf3c303dc4276b | |
parent | 1772be37fc9d2775ae48c8b3bc34f1899effb7b3 (diff) |
samples/bpf: xdp_monitor, accept short options
Updated optstring parameter for getopt_long() to accept short options.
Also updated usage() function.
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r-- | samples/bpf/xdp_monitor_user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c index 894bc64c2cac..05ad3f590c91 100644 --- a/samples/bpf/xdp_monitor_user.c +++ b/samples/bpf/xdp_monitor_user.c | |||
@@ -58,7 +58,7 @@ static void usage(char *argv[]) | |||
58 | printf(" flag (internal value:%d)", | 58 | printf(" flag (internal value:%d)", |
59 | *long_options[i].flag); | 59 | *long_options[i].flag); |
60 | else | 60 | else |
61 | printf("(internal short-option: -%c)", | 61 | printf("short-option: -%c", |
62 | long_options[i].val); | 62 | long_options[i].val); |
63 | printf("\n"); | 63 | printf("\n"); |
64 | } | 64 | } |
@@ -594,7 +594,7 @@ int main(int argc, char **argv) | |||
594 | snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); | 594 | snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); |
595 | 595 | ||
596 | /* Parse commands line args */ | 596 | /* Parse commands line args */ |
597 | while ((opt = getopt_long(argc, argv, "h", | 597 | while ((opt = getopt_long(argc, argv, "hDSs:", |
598 | long_options, &longindex)) != -1) { | 598 | long_options, &longindex)) != -1) { |
599 | switch (opt) { | 599 | switch (opt) { |
600 | case 'D': | 600 | case 'D': |