Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2868

to look at the new patch set (#3).

Fix BTS attribute requests

* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all
  BTS' as it's explained in 3GPP TS 52.021 ยง9.3.
* only request attributes from supported (OsmoBTS) types

Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b
Related: OS#2317
---
M openbsc/src/libbsc/abis_nm.c
M openbsc/src/libbsc/bsc_init.c
2 files changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/2868/3

diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 019d039..cf20d7c 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -1590,10 +1590,17 @@
                     const uint8_t *attr, uint8_t attr_len)
 {
        struct abis_om_hdr *oh;
-       struct msgb *msg = nm_msgb_alloc();
+       struct msgb *msg;
+
+       if (bts->type != GSM_BTS_TYPE_OSMOBTS) {
+               LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s 
is not supported.\n",
+                     bts->nr, btstype2str(bts->type));
+               return -EINVAL;
+       }
 
        DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr);
 
+       msg = nm_msgb_alloc();
        oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
        fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class,
                        bts_nr, trx_nr, ts_nr);
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index ec87a7b..ead21b4 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -349,12 +349,12 @@
                        generate_cell_chan_list(ca, trx->bts);
 
                        /* Request generic BTS-level attributes */
-                       abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, 
trx->nr, 0xFF, bts_attr, sizeof(bts_attr));
+                       abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, 
bts_attr, sizeof(bts_attr));
 
                        llist_for_each_entry(cur_trx, &trx->bts->trx_list, 
list) {
                                int i;
                                /* Request TRX-level attributes */
-                               abis_nm_get_attr(cur_trx->bts, 
NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF,
+                               abis_nm_get_attr(cur_trx->bts, 
NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF,
                                                 trx_attr, sizeof(trx_attr));
                                for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++)
                                        generate_ma_for_ts(&cur_trx->ts[i]);

-- 
To view, visit https://gerrit.osmocom.org/2868
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <[email protected]>

Reply via email to