[libss7-commits] mattf: branch mattf/bug13495 r234 - /team/mattf/bug13495/mtp3.c

SVN commits to the libss7 project libss7-commits at lists.digium.com
Sat Dec 6 11:40:47 CST 2008


Author: mattf
Date: Sat Dec  6 11:40:46 2008
New Revision: 234

URL: http://svn.digium.com/view/libss7?view=rev&rev=234
Log:
Add a function that checks a link's DPC when sending MTP3 management messages

Modified:
    team/mattf/bug13495/mtp3.c

Modified: team/mattf/bug13495/mtp3.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/mtp3.c?view=diff&rev=234&r1=233&r2=234
==============================================================================
--- team/mattf/bug13495/mtp3.c (original)
+++ team/mattf/bug13495/mtp3.c Sat Dec  6 11:40:46 2008
@@ -339,7 +339,7 @@
 	layer4 = ss7_msg_userpart(m);
 	rl.type = ss7->switchtype;
 	rl.opc = ss7->pc;
-	rl.dpc = link->dpc;
+	rl.dpc = link->adj_sp->adjpc;
 	rl.sls = link->slc;
 
 	rllen = set_routinglabel(layer4, &rl);
@@ -1669,6 +1669,21 @@
 	return 0;
 }
 
+static struct mtp2 * rl_to_mtp2_nomtp3check(struct ss7 *ss7, struct routing_label rl)
+{
+	int i = 0;
+	struct mtp2 *link = NULL;
+
+	for (i = 0; i < ss7->numlinks; i++) {
+		if (ss7->links[i]->slc == rl.sls && (ss7->links[i]->adj_sp->adjpc == rl.dpc)) {
+			link = ss7->links[i];
+			break;
+		}
+	}
+
+	return link;
+}
+
 int mtp3_transmit(struct ss7 *ss7, unsigned char userpart, struct routing_label rl, struct ss7_msg *m)
 {
 	unsigned char *sio;
@@ -1683,7 +1698,7 @@
 	if (userpart == SIG_ISUP)
 		winner = rl_to_link(ss7, rl, &buffer);
 	else
-		winner = slc_to_mtp2(ss7, rl.sls);
+		winner = rl_to_mtp2_nomtp3check(ss7, rl);
 
 	if (ss7->switchtype == SS7_ITU)
 		(*sio) = (ss7->ni << 6) | userpart;




More information about the libss7-commits mailing list