diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-13 21:45:23 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-13 21:45:23 +0200 |
commit | 58e65c90a8fc43624d45acd173b0454796fa971d (patch) | |
tree | 3cff7b1e6aaee07568079826f20add9822d7ba1e /openbsc/src/gprs/gprs_bssgp.c | |
parent | 25de8110235e10874696e0c2e9598d712ec47b48 (diff) |
[GPRS] BSSGP: Refuse blocking of signalling BVC; Ignore traffic on blocked BVC
Diffstat (limited to 'openbsc/src/gprs/gprs_bssgp.c')
-rw-r--r-- | openbsc/src/gprs/gprs_bssgp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_bssgp.c b/openbsc/src/gprs/gprs_bssgp.c index 45e3de51..9add00fb 100644 --- a/openbsc/src/gprs/gprs_bssgp.c +++ b/openbsc/src/gprs/gprs_bssgp.c @@ -198,6 +198,13 @@ static int bssgp_rx_bvc_block(struct msgb *msg, struct tlv_parsed *tp) struct bssgp_bts_ctx *ptp_ctx; bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI)); + if (bvci == 0) { + /* 8.3.2: Signalling BVC shall never be blocked */ + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u/BVCI=%u " + "received block for signalling BVC!?!\n", + msgb_nsei(msg), msgb_bvci(msg)); + return 0; + } LOGP(DBSSGP, LOGL_INFO, "BVCI=%u BVC-BLOCK\n", bvci); @@ -221,6 +228,13 @@ static int bssgp_rx_bvc_unblock(struct msgb *msg, struct tlv_parsed *tp) struct bssgp_bts_ctx *ptp_ctx; bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI)); + if (bvci == 0) { + /* 8.3.2: Signalling BVC shall never be blocked */ + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u/BVCI=%u " + "received unblock for signalling BVC!?!\n", + msgb_nsei(msg), msgb_bvci(msg)); + return 0; + } DEBUGP(DBSSGP, "BVCI=%u BVC-UNBLOCK\n", bvci); @@ -322,6 +336,14 @@ static int gprs_bssgp_rx_ptp(struct msgb *msg, struct tlv_parsed *tp, uint8_t pdu_type = bgph->pdu_type; int rc = 0; + /* If traffic is received on a BVC that is marked as blocked, the + * received PDU shall not be accepted and a STATUS PDU (Cause value: + * BVC Blocked) shall be sent to the peer entity on the signalling BVC */ + if (bctx->state & BVC_S_BLOCKED && pdu_type != BSSGP_PDUT_STATUS) { + uint16_t bvci = msgb_bvci(msg); + return bssgp_tx_status(BSSGP_CAUSE_BVCI_BLOCKED, &bvci, msg); + } + switch (pdu_type) { case BSSGP_PDUT_UL_UNITDATA: /* some LLC data from the MS */ |