@@ -245,15 +245,17 @@ int check_oml_msg(struct msgb *msg)
if (omh->mdisc == ABIS_OM_MDISC_MANUF) {
strncpy(label_id, (const char *) msg->l3h + 1,
- sizeof(ipaccess_magic) + 1);
+ sizeof(ipaccess_magic));
if (strncmp(ipaccess_magic, label_id,
- sizeof(ipaccess_magic) + 1) == 0)
+ sizeof(ipaccess_magic)) == 0) {
msg->l3h = msg->l3h + sizeof(ipaccess_magic) + 1;
- else if (strncmp(osmocom_magic, label_id,
- sizeof(osmocom_magic) + 1) == 0)
+ return MANUFACTURER_MSG_IPA_TYPE;
+ } else if (strncmp(osmocom_magic, label_id,
+ sizeof(osmocom_magic)) == 0) {
msg->l3h = msg->l3h + sizeof(osmocom_magic) + 1;
- else {
+ return MANUFACTURER_MSG_OSMO_TYPE;
+ } else {
msg->l3h = NULL;
LOGP(DL1C, LOGL_ERROR,
"Manuf Label Unknown %s\n", label_id);
@@ -261,7 +263,7 @@ int check_oml_msg(struct msgb *msg)
}
}
- return 0;
+ return OML_MSG_TYPE;
}
int check_ipa_header(struct msgb *msg)
@@ -21,6 +21,12 @@ enum manuf_type_id {
OSMOCOM_MANUF_ID,
};
+enum check_message_type {
+ OML_MSG_TYPE,
+ MANUFACTURER_MSG_IPA_TYPE,
+ MANUFACTURER_MSG_OSMO_TYPE,
+};
+
static const char osmocom_magic[] = "org.osmocom";
static const char ipaccess_magic[] = "com.ipaccess";