summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/mobile/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c
index 115ac419..e015c301 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -99,7 +99,7 @@ static void print_help()
"offer socket\n");
}
-static void handle_options(int argc, char **argv)
+static int handle_options(int argc, char **argv)
{
while (1) {
int option_index = 0, c;
@@ -148,9 +148,12 @@ static void handle_options(int argc, char **argv)
use_mncc_sock = 1;
break;
default:
- break;
+ /* Unknown parameter passed */
+ return -EINVAL;
}
}
+
+ return 0;
}
void sighandler(int sigset)
@@ -218,7 +221,11 @@ int main(int argc, char **argv)
/* Init default stderr logging */
osmo_init_logging2(l23_ctx, &log_info);
- handle_options(argc, argv);
+ rc = handle_options(argc, argv);
+ if (rc) { /* Abort in case of parsing errors */
+ fprintf(stderr, "Error in command line options. Exiting.\n");
+ return 1;
+ }
if (gsmtap_ip) {
gsmtap_inst = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1);