aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-26 05:20:18 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:40:12 +0100
commit8d1ffbd3ba44939612d453b161dd86ba8302d0c1 (patch)
tree3c8e60d70b56cb2686207cdded356b21a44e2d4e
parent005f175c3b9a3182d429de9177438564b8a7e4f6 (diff)
gtphub: complain about excess cmdline args.
Sponsored-by: On-Waves ehi
-rw-r--r--openbsc/src/gprs/gtphub_main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gtphub_main.c b/openbsc/src/gprs/gtphub_main.c
index 06260bf93..025a2d1a2 100644
--- a/openbsc/src/gprs/gtphub_main.c
+++ b/openbsc/src/gprs/gtphub_main.c
@@ -176,8 +176,15 @@ static void handle_options(struct cmdline_cfg *ccfg, int argc, char **argv)
c = getopt_long(argc, argv, "hd:Dc:sTe:",
long_options, &option_index);
- if (c == -1)
+ if (c == -1) {
+ if (optind < argc) {
+ LOGP(DGTPHUB, LOGL_FATAL,
+ "Excess commandline arguments ('%s').\n",
+ argv[optind]);
+ exit(2);
+ }
break;
+ }
switch (c) {
case 'h':