aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-24 19:21:01 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-24 19:21:01 +0100
commitebdbc1140388255b27479f752d0813d986ca1c03 (patch)
tree8c3accc45fc3bf653b098add749fa87c38e5a041
parentd1df399a972ce2b96b0d3ef9e90d17a7c16a93b5 (diff)
m3ua: Use the MTP_READ_DPC/MTP_READ_OPC for using the right PC
Make the code work for both ISUP and SCCP and let the address handling still be part of the linkset/mtp3 code.
-rw-r--r--src/sctp_m3ua_client.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sctp_m3ua_client.c b/src/sctp_m3ua_client.c
index dd378bb..cb9fab3 100644
--- a/src/sctp_m3ua_client.c
+++ b/src/sctp_m3ua_client.c
@@ -23,6 +23,7 @@
#include <osmocom/sigtran/xua_msg.h>
#include <osmocom/sigtran/m3ua_types.h>
+#include <osmocom/mtp/mtp_level3.h>
#include <osmocom/core/talloc.h>
@@ -264,17 +265,15 @@ static int m3ua_write(struct mtp_link *mtp_link, struct msgb *msg)
case MTP_SI_MNT_SNM_MSG:
case MTP_SI_MNT_REG_MSG:
LOGP(DINP, LOGL_ERROR,
- "Dropping SNM/REG/ISUP/??? message %d\n", mtp_hdr->ser_ind);
+ "Dropping SNM/REG message %d\n", mtp_hdr->ser_ind);
goto clean;
break;
case MTP_SI_MNT_ISUP:
case MTP_SI_MNT_SCCP:
default:
- /* TODO... read OPC/DPC from message.. */
memset(&proto_data, 0, sizeof(proto_data));
- proto_data.opc = htonl(mtp_link->set->sccp_opc);
- proto_data.dpc = htonl(mtp_link->set->sccp_dpc == -1 ?
- mtp_link->set->sccp_dpc : mtp_link->set->dpc);
+ proto_data.opc = htonl(MTP_READ_OPC(mtp_hdr->addr));
+ proto_data.dpc = htonl(MTP_READ_DPC(mtp_hdr->addr));
proto_data.sls = MTP_LINK_SLS(mtp_hdr->addr);
proto_data.si = mtp_hdr->ser_ind;
proto_data.ni = mtp_link->set->ni;