diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-28 17:03:13 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-28 17:07:58 +0200 |
commit | 459c12752011b3079f47591d52ed108c6193c51f (patch) | |
tree | 5584c92b2d03d2aa0eec5e411b42d142c88cb2dd /openbsc | |
parent | 4f889c8e6c8577759439dd725aa8413d13cf0d07 (diff) |
bsc_vty: Write access list entries when storing bsc config
Back-port from osmo-bsc.git d99182c01037f4dd14fb72b2b06497e0c1bebb49.
Change-Id: I0b951a9c3dbe245c3813fc91ceb9118a0de779b8
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/bsc_msg_filter.h | 2 | ||||
-rw-r--r-- | openbsc/src/libfilter/bsc_msg_vty.c | 10 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_vty.c | 2 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 5 |
4 files changed, 14 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/openbsc/include/openbsc/bsc_msg_filter.h index dc971a4f8..22b8447cc 100644 --- a/openbsc/include/openbsc/bsc_msg_filter.h +++ b/openbsc/include/openbsc/bsc_msg_filter.h @@ -104,4 +104,4 @@ struct bsc_msg_acc_lst_entry *bsc_msg_acc_lst_entry_create(struct bsc_msg_acc_ls int bsc_msg_acc_lst_check_allow(struct bsc_msg_acc_lst *lst, const char *imsi); void bsc_msg_acc_lst_vty_init(void *ctx, struct llist_head *lst, int node); -void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst); +void bsc_msg_acc_lst_write(struct vty *vty); diff --git a/openbsc/src/libfilter/bsc_msg_vty.c b/openbsc/src/libfilter/bsc_msg_vty.c index 06f38764c..668e399d8 100644 --- a/openbsc/src/libfilter/bsc_msg_vty.c +++ b/openbsc/src/libfilter/bsc_msg_vty.c @@ -111,7 +111,7 @@ DEFUN(cfg_lst_imsi_deny, return CMD_SUCCESS; } -void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst) +static void bsc_msg_acc_lst_write_one(struct vty *vty, struct bsc_msg_acc_lst *lst) { struct bsc_msg_acc_lst_entry *entry; @@ -127,6 +127,14 @@ void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst) } } +void bsc_msg_acc_lst_write(struct vty *vty) +{ + struct bsc_msg_acc_lst *lst; + llist_for_each_entry(lst, _acc_lst, list) { + bsc_msg_acc_lst_write_one(vty, lst); + } +} + void bsc_msg_acc_lst_vty_init(void *ctx, struct llist_head *lst, int node) { _ctx = ctx; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c index e124b31fc..66e59bdf0 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c @@ -221,6 +221,8 @@ static int config_write_bsc(struct vty *vty) if (bsc->acc_lst_name) vty_out(vty, " access-list-name %s%s", bsc->acc_lst_name, VTY_NEWLINE); + bsc_msg_acc_lst_write(vty); + return CMD_SUCCESS; } diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index 7ddcb5750..eba968a4f 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -129,7 +129,6 @@ static int config_write_bsc(struct vty *vty) static int config_write_nat(struct vty *vty) { - struct bsc_msg_acc_lst *lst; struct bsc_nat_paging_group *pgroup; vty_out(vty, "nat%s", VTY_NEWLINE); @@ -179,8 +178,8 @@ static int config_write_nat(struct vty *vty) vty_out(vty, " prefix-tree %s%s", _nat->num_rewr_trie_name, VTY_NEWLINE); - llist_for_each_entry(lst, &_nat->access_lists, list) - bsc_msg_acc_lst_write(vty, lst); + bsc_msg_acc_lst_write(vty); + llist_for_each_entry(pgroup, &_nat->paging_groups, entry) write_pgroup_lst(vty, pgroup); if (_nat->mgcp_ipa) |