From 72bbdfcd3505dcb6933ea13bab88d422fed4e6e7 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 19 Nov 2021 11:39:10 +0100 Subject: 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 --- src/osmo-bsc/abis_nm.c | 16 ++++++---------- 1 file 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 #include #include +#include #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"); -- cgit v1.2.3