From f1e13d6081920b7f65c0ff70c19fb638a7fc86fa Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Mon, 25 Jun 2018 12:20:43 +0200 Subject: return error to sender upon bssgp_tlv_parse() failure Return "invalid mandatory information" error status to the sender in case bssgp_tlv_parse() failed. To avoid loops, do not respond with an error status to STATUS PDUs which failed parsing. Change-Id: If73719b75a94d6742bdefc9b6572525cb00a96ee Related: OS#3178 --- src/gb/gprs_bssgp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gb') diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 1445a56b..5dfce16c 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1052,6 +1052,8 @@ int bssgp_rcvmsg(struct msgb *msg) if (rc < 0) { LOGP(DBSSGP, LOGL_ERROR, "Failed to parse BSSGP %s message. Invalid message was: %s\n", bssgp_pdu_str(pdu_type), msgb_hexdump(msg)); + if (pdu_type != BSSGP_PDUT_STATUS) + return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, msg); return rc; } -- cgit v1.2.3