aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-10 06:21:08 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-08-10 06:37:35 +0200
commitf2312cb04c55b074dfe908b336fc19439f60b7d3 (patch)
tree5fa088f12849e3ad01044526a3016bac90a3c856 /src
parentab79b9b593cbde7064a7e4ad49867c36f969cadd (diff)
sctp: Check if there is any other connection with the ASP ident
When we get an ASP UP check if there is any other ASP that is using the same identifier and then complain.
Diffstat (limited to 'src')
-rw-r--r--src/sctp_m2ua.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c
index cdcf8cf..862c701 100644
--- a/src/sctp_m2ua.c
+++ b/src/sctp_m2ua.c
@@ -151,6 +151,8 @@ static int m2ua_handle_asp_ack(struct sctp_m2ua_conn *conn,
struct m2ua_msg *m2ua,
struct sctp_sndrcvinfo *info)
{
+ struct sctp_m2ua_transport *trans = conn->trans;
+ struct sctp_m2ua_conn *tmp;
struct m2ua_msg_part *asp_ident;
struct m2ua_msg *ack;
@@ -181,6 +183,19 @@ static int m2ua_handle_asp_ack(struct sctp_m2ua_conn *conn,
memcpy(conn->asp_ident, asp_ident->dat, 4);
conn->asp_up = 1;
+ /* some verification about the ASPs */
+ llist_for_each_entry(tmp, &trans->conns, entry) {
+ if (tmp != conn)
+ continue;
+ if (memcmp(tmp->asp_ident, conn->asp_ident, 4) != 0)
+ continue;
+ LOGP(DINP, LOGL_ERROR,
+ "Two active SCTP conns with %d.%d.%d.%d on %p, %p\n",
+ conn->asp_ident[0], conn->asp_ident[1],
+ conn->asp_ident[2], conn->asp_ident[3],
+ tmp, conn);
+ }
+
m2ua_msg_free(ack);
return 0;
}