[PATCH net-next-2.6 v4 5/5] sctp: Add ADD/DEL ASCONF handling at the receiver

DORMANTno replies

From: Michio Honda <hidden>
Date: 2011-04-20 19:24:56
Subsystem: networking [general], sctp protocol, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Marcelo Ricardo Leitner, Xin Long, Linus Torvalds

With this patch, ASCONF receiver supports deletion of the source address of the ASCONF chunk when the ADDIP co-located in the earlier parameter.  

Signed-off-by: Michio Honda <redacted>
---
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index de98665..a5d673b 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2914,6 +2914,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 	struct sctp_af *af;
 	union sctp_addr	addr;
 	union sctp_addr_param *addr_param;
+	int del_srcaddr_ok = 0;
 
 	addr_param = (union sctp_addr_param *)
 			((void *)asconf_param + sizeof(sctp_addip_param_t));
@@ -2973,6 +2974,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		/* Start the heartbeat timer. */
 		if (!mod_timer(&peer->hb_timer, sctp_transport_timeout(peer)))
 			sctp_transport_hold(peer);
+		del_srcaddr_ok = 1;
 		break;
 	case SCTP_PARAM_DEL_IP:
 		/* ADDIP 4.3 D7) If a request is received to delete the
@@ -2990,7 +2992,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		 * an Error Cause TLV set to the new error code 'Request to
 		 * Delete Source IP Address'
 		 */
-		if (sctp_cmp_addr_exact(sctp_source(asconf), &addr))
+		if (sctp_cmp_addr_exact(sctp_source(asconf), &addr) &&
+		    !del_srcaddr_ok)
 			return SCTP_ERROR_DEL_SRC_IP;
 
 		/* Section 4.2.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help