From 5980de7e84c077811734461dead2fe9cbabb5968 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 17 Feb 2011 23:29:41 +0100 Subject: m2ua: Make sure all replies contain the link identifier --- src/sctp_m2ua.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3