aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-11-19 11:39:10 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2021-11-19 11:43:07 +0100
commit72bbdfcd3505dcb6933ea13bab88d422fed4e6e7 (patch)
tree6aba2414ff7c6843088b9b5b936f9c60695a450e
parent0505e35cb721481de8f1147edf9724b4c7f22c75 (diff)
abis_nm: use struct sdp_firmware from libosmocore
abis_nm locally declares its own struct for the ipaccess firmware header, even though libosmocore defines it as well. Lets use the definition from libosmocore. Change-Id: I69cb45fc40bd20ea2533cc8cd6a68363b59cc408
-rw-r--r--src/osmo-bsc/abis_nm.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index aeb4ba313..1c21bc265 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -51,6 +51,7 @@
#include <osmocom/bsc/bts.h>
#include <osmocom/bsc/nm_common_fsm.h>
#include <osmocom/gsm/bts_features.h>
+#include <osmocom/bsc/ipaccess.h>
#define OM_ALLOC_SIZE 1024
#define OM_HEADROOM_SIZE 128
@@ -1342,13 +1343,6 @@ static int sw_activate(struct abis_nm_sw *sw)
return abis_nm_sendmsg(sw->bts, msg);
}
-struct sdp_firmware {
- char magic[4];
- char more_magic[4];
- unsigned int header_length;
- unsigned int file_length;
-} __attribute__ ((packed));
-
static int parse_sdp_header(struct abis_nm_sw *sw)
{
const struct gsm_abis_mo *mo = &sw->bts->mo;
@@ -1368,13 +1362,15 @@ static int parse_sdp_header(struct abis_nm_sw *sw)
}
if (firmware_header.more_magic[0] != 0x10 ||
- firmware_header.more_magic[1] != 0x02 ||
- firmware_header.more_magic[2] != 0x00 ||
- firmware_header.more_magic[3] != 0x00) {
+ firmware_header.more_magic[1] != 0x02) {
LOGPMO(mo, DNM, LOGL_ERROR, "The more magic number is wrong.\n");
return -1;
}
+ if (firmware_header.more_more_magic != 0x0000) {
+ LOGPMO(mo, DNM, LOGL_ERROR, "The more more magic number is wrong.\n");
+ return -1;
+ }
if (fstat(sw->fd, &stat) == -1) {
LOGPMO(mo, DNM, LOGL_ERROR, "Could not stat the file.\n");