diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 05:26:24 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 05:27:58 +0100 |
commit | ff9d8b42e6f11bda1a9801f68448106278333058 (patch) | |
tree | 2375335230932abf0a5e1b8b48714076d6c9b86f /openbsc/src/ipaccess | |
parent | dc6af631e54ed792a85d8e12c6a0e99370ead907 (diff) |
ipa: Make it possible to specify -w and -f in any order
Currently one has to put -w in front of -f to really write the
firmware file to disk. Change the config handling to first take
all parameters and then execute on them. This means -f can now
be used with any other parameter.
Diffstat (limited to 'openbsc/src/ipaccess')
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-config.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 93fe44236..870950d0e 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -58,6 +58,7 @@ static char *software = NULL; static int sw_load_state = 0; static int oml_state = 0; static int dump_files = 0; +static char *firmware_analysis = NULL; struct sw_load { u_int8_t file_id[255]; @@ -677,8 +678,8 @@ int main(int argc, char **argv) exit(0); break; case 'f': - analyze_firmware(optarg); - exit(0); + firmware_analysis = optarg; + break; case 'w': dump_files = 1; break; @@ -689,8 +690,13 @@ int main(int argc, char **argv) } }; + if (firmware_analysis) + analyze_firmware(firmware_analysis); + if (optind >= argc) { - fprintf(stderr, "you have to specify the IP address of the BTS. Use --help for more information\n"); + /* only warn if we have not done anything else */ + if (!firmware_analysis) + fprintf(stderr, "you have to specify the IP address of the BTS. Use --help for more information\n"); exit(2); } |