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
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index eb1a699..cbf2e90 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -1327,10 +1327,10 @@
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 @@
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) {