aboutsummaryrefslogtreecommitdiffstats
path: root/src/sctp_m2ua.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-17 23:29:41 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-22 21:05:59 +0100
commite62e4b05bf421d9336ea4c442df1d4b40d3f170f (patch)
tree2097ab8a8807800001c39e8c1399fb97f1bfd4bd /src/sctp_m2ua.c
parentcfe9d718e27b812da4b90c5bda2fea8c9ce4ff7b (diff)
m2ua: Make sure all replies contain the link identifier
Diffstat (limited to 'src/sctp_m2ua.c')
-rw-r--r--src/sctp_m2ua.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c
index 9e17161..3bed8ee 100644
--- a/src/sctp_m2ua.c
+++ b/src/sctp_m2ua.c
@@ -279,6 +279,7 @@ static int m2ua_handle_state_req(struct mtp_m2ua_link *link,
{
struct m2ua_msg_part *state;
struct m2ua_msg *conf;
+ uint32_t index;
int req;
if (link->conn != conn) {
@@ -303,9 +304,10 @@ static int m2ua_handle_state_req(struct mtp_m2ua_link *link,
if (!conf)
return -1;
+ index = htonl(link->link_index);
conf->hdr.msg_class = M2UA_CLS_MAUP;
conf->hdr.msg_type = M2UA_MAUP_STATE_CON;
- m2ua_msg_add_data(conf, MUA_TAG_IDENT_INT, 4, (uint8_t *) &link->link_index);
+ m2ua_msg_add_data(conf, MUA_TAG_IDENT_INT, 4, (uint8_t *) &index);
m2ua_msg_add_data(conf, M2UA_TAG_STATE_REQ, 4, (uint8_t *) &req);
if (m2ua_conn_send(conn, conf, info) != 0) {
m2ua_msg_free(conf);
@@ -330,6 +332,7 @@ static int m2ua_handle_est_req(struct mtp_m2ua_link *link,
struct m2ua_msg *m2ua,
struct sctp_sndrcvinfo *info)
{
+ uint32_t index;
struct m2ua_msg *conf;
conf = m2ua_msg_alloc();
@@ -339,6 +342,9 @@ static int m2ua_handle_est_req(struct mtp_m2ua_link *link,
conf->hdr.msg_class = M2UA_CLS_MAUP;
conf->hdr.msg_type = M2UA_MAUP_EST_CON;
+ index = htonl(link->link_index);
+ m2ua_msg_add_data(conf, MUA_TAG_IDENT_INT, 4, (uint8_t *) &index);
+
if (m2ua_conn_send(conn, conf, info) != 0) {
link->established = 0;
m2ua_msg_free(conf);
@@ -355,6 +361,7 @@ static int m2ua_handle_rel_req(struct mtp_m2ua_link *link,
struct m2ua_msg *m2ua,
struct sctp_sndrcvinfo *info)
{
+ uint32_t index;
struct m2ua_msg *conf;
conf = m2ua_msg_alloc();
@@ -364,6 +371,9 @@ static int m2ua_handle_rel_req(struct mtp_m2ua_link *link,
conf->hdr.msg_class = M2UA_CLS_MAUP;
conf->hdr.msg_type = M2UA_MAUP_REL_CON;
+ index = htonl(link->link_index);
+ m2ua_msg_add_data(conf, MUA_TAG_IDENT_INT, 4, (uint8_t *) &index);
+
if (m2ua_conn_send(conn, conf, info) != 0) {
m2ua_msg_free(conf);
return -1;