From 8196de46ad4886afd3e3c6068e491b8132c5c16f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 19 Jan 2014 15:07:02 +0100 Subject: common/oml.c: Send OML NACK if bts_model_check_oml() returns negative This way, bts_model_check_oml() can return a negated NM_NACK_* constant which will then be sent as cause value in the corresponding SET_ATTR_NACK back to the BSC. --- src/common/oml.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/common/oml.c') diff --git a/src/common/oml.c b/src/common/oml.c index bf174b5f..143cc0d8 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -436,8 +436,7 @@ static int oml_rx_set_bts_attr(struct gsm_bts *bts, struct msgb *msg) rc = bts_model_check_oml(bts, foh->msg_type, bts->mo.nm_attr, tp_merged, bts); if (rc < 0) { talloc_free(tp_merged); - /* FIXME: send nack? */ - return rc; + return oml_fom_ack_nack(msg, -rc); } /* Success: replace old BTS attributes with new */ @@ -551,8 +550,7 @@ static int oml_rx_set_radio_attr(struct gsm_bts_trx *trx, struct msgb *msg) rc = bts_model_check_oml(trx->bts, foh->msg_type, trx->mo.nm_attr, tp_merged, trx); if (rc < 0) { talloc_free(tp_merged); - /* FIXME: send NACK */ - return rc; + return oml_fom_ack_nack(msg, -rc); } /* Success: replace old BTS attributes with new */ @@ -671,8 +669,8 @@ static int oml_rx_set_chan_attr(struct gsm_bts_trx_ts *ts, struct msgb *msg) rc = bts_model_check_oml(bts, foh->msg_type, ts->mo.nm_attr, tp_merged, ts); if (rc < 0) { talloc_free(tp_merged); - /* FIXME: Send NACK */ - return rc; + /* Send NACK */ + return oml_fom_ack_nack(msg, -rc); } /* Success: replace old BTS attributes with new */ -- cgit v1.2.3