diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-12 23:16:59 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-13 00:40:40 +0800 |
commit | ebead597ff571ac6d4eb2986b64aa5242a563382 (patch) | |
tree | b59c3ca4dd647f94bc685f5c114c4460045c9af2 | |
parent | 9958f477b4b98f0c2d99a766612f44e080a94d3b (diff) |
ipaccess: Refactor... unite some code
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-config.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 0f8c16c0b..da0131ace 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -92,23 +92,23 @@ static int ipacc_msg_nack(u_int8_t mt) return 0; } +static void check_restart_or_exit(struct gsm_bts *bts) +{ + if (restart) { + abis_nm_ipaccess_restart(bts); + } else { + exit(0); + } +} + static int ipacc_msg_ack(u_int8_t mt, struct gsm_bts *bts) { if (sw_load_state == 1) { fprintf(stderr, "The new software is activaed.\n"); - - if (restart) { - abis_nm_ipaccess_restart(bts); - } else { - exit(0); - } + check_restart_or_exit(bts); } else if (oml_state == 1) { fprintf(stderr, "Set the primary OML IP.\n"); - if (restart) { - abis_nm_ipaccess_restart(bts); - } else { - exit(0); - } + check_restart_or_exit(bts); } return 0; |