aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/main.c
diff options
context:
space:
mode:
authorÁlvaro Neira Ayuso <anayuso@sysmocom.de>2014-05-20 07:40:47 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-20 09:37:30 +0200
commit13a224063dfcee0be529fba1c8fb9be9c1fb261e (patch)
treedca65fa1192a3c9068af571f721a79dab58daac8 /src/osmo-bts-sysmo/main.c
parent0a1699ff8a5462c167c24e8b28186abb26331698 (diff)
sysmobts: Separate IPA and OML check into two methods
I have split the function check_oml_msg, in two functions. One for checking if the ipa header is well-formed and in check_oml_msg, Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
Diffstat (limited to 'src/osmo-bts-sysmo/main.c')
-rw-r--r--src/osmo-bts-sysmo/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index bd6a1818..797f1741 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -317,7 +317,16 @@ static int read_sock(struct osmo_fd *fd, unsigned int what)
msgb_put(msg, rc);
- if (check_oml_msg(msg) < 0) {
+ rc = check_ipa_header(msg);
+ if (rc < 0) {
+ LOGP(DL1C, LOGL_ERROR, "Malformed receive message: Ipa hdr\n");
+ goto err;
+ }
+
+ msgb_pull(msg, sizeof(struct ipaccess_head));
+
+ rc = check_oml_msg(msg);
+ if (rc < 0) {
LOGP(DL1C, LOGL_ERROR, "Malformed receive message\n");
goto err;
}