diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-08-18 16:50:11 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-08-24 16:16:39 +0200 |
commit | 3b23d639ab667de85dd18ac89f8e9315cb43710f (patch) | |
tree | 0af882c30fc74c735e7e965ce83a3de586fe60c7 /openbsc/src/gprs/gb_proxy.c | |
parent | 12496dd7db41b3de8a9fe71b843c9378360b33d3 (diff) |
gbproxy: Also handle LLC non UI and LL11 messages
Currently, these messages lead to a parsing error which prevents them
from being processed any further.
This patch sets the return value of gbprox_parse_llc to 1 in these
cases and fixes a segfault which is triggered by any non-04.08
message.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index eb1a699e4..cbf2e9075 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1327,10 +1327,10 @@ static int gbprox_parse_llc(uint8_t *llc, size_t llc_len, return 0; if (ghp->sapi != GPRS_SAPI_GMM) - return 0; + return 1; if (ghp->cmd != GPRS_LLC_UI) - return 0; + return 1; if (ghp->is_encrypted) { parse_ctx->need_decryption = 1; @@ -1354,7 +1354,7 @@ static int gbprox_patch_llc(struct msgb *msg, uint8_t *llc, size_t llc_len, int have_patched = 0; int fcs; - if (!allow_message_patching(peer, parse_ctx->g48_hdr->msg_type)) + if (parse_ctx->g48_hdr && !allow_message_patching(peer, parse_ctx->g48_hdr->msg_type)) return have_patched; if (parse_ctx->raid_enc) { |