From ebdbc1140388255b27479f752d0813d986ca1c03 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 24 Mar 2015 19:21:01 +0100 Subject: 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. --- src/sctp_m3ua_client.c | 9 ++++----- 1 file 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 #include +#include #include @@ -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; -- cgit v1.2.3