diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index 1bd38de1..4d4cec0a 100755 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -1036,7 +1036,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb) else DEBUGPC(DNM, "\n"); - dispatch_signal(SS_NM, S_NM_NACK, (void*) ((long)mt)); + dispatch_signal(SS_NM, S_NM_NACK, (void*) &mt); return 0; } #if 0 @@ -2601,7 +2601,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg) case NM_MT_IPACC_RSL_CONNECT_NACK: case NM_MT_IPACC_SET_NVATTR_NACK: case NM_MT_IPACC_GET_NVATTR_NACK: - dispatch_signal(SS_NM, S_NM_IPACC_NACK, (void*) ((long)foh->msg_type)); + dispatch_signal(SS_NM, S_NM_IPACC_NACK, &foh->msg_type); break; default: break; diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c index 815fe2b6..bb1e382f 100644 --- a/openbsc/src/bsc_init.c +++ b/openbsc/src/bsc_init.c @@ -443,7 +443,7 @@ static int sw_activ_rep(struct msgb *mb) } /* Callback function for NACK on the OML NM */ -static int oml_msg_nack(int mt) +static int oml_msg_nack(u_int8_t mt) { if (mt == NM_MT_SET_BTS_ATTR_NACK) { fprintf(stderr, "Failed to set BTS attributes. That is fatal. " @@ -458,11 +458,14 @@ static int oml_msg_nack(int mt) static int nm_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { + u_int8_t *msg_type; + switch (signal) { case S_NM_SW_ACTIV_REP: return sw_activ_rep(signal_data); case S_NM_NACK: - return oml_msg_nack((int)signal_data); + msg_type = signal_data; + return oml_msg_nack(*msg_type); default: break; } diff --git a/openbsc/src/ipaccess-config.c b/openbsc/src/ipaccess-config.c index 49c0ea31..1b2aa5e3 100644 --- a/openbsc/src/ipaccess-config.c +++ b/openbsc/src/ipaccess-config.c @@ -61,7 +61,7 @@ static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', * result. The nanoBTS will send us a NACK when we did something the * BTS didn't like. */ -static int ipacc_msg_nack(int mt) +static int ipacc_msg_nack(u_int8_t mt) { fprintf(stderr, "Failure to set attribute. This seems fatal\n"); exit(-1); @@ -149,9 +149,12 @@ static int test_rep(void *_msg) static int nm_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { + u_int8_t *msg_type; + switch (signal) { case S_NM_IPACC_NACK: - return ipacc_msg_nack((int)signal_data); + msg_type = signal_data; + return ipacc_msg_nack(*msg_type); case S_NM_TEST_REP: return test_rep(signal_data); default: