Subject: Re: [PATCH net-next-2.6 v3 2/3] sctp: Add ASCONF operation on the single-homed host

From: Wei Yongjun <[email-masked]>
Date: Wed, 13 Apr 2011 09:14:33 +0800

Hi, Michio Honda

> SCTP can change the IP address on the single-homed host.  
> In this case, the SCTP association transmits an ASCONF packet including addition of the new IP address and deletion of the old address.  
> This patch implements this functionality.  
>
>

...snip...

>  
> @@ -1277,7 +1284,7 @@ void sctp_assoc_update(struct sctp_association *asoc,
>   */
>  void sctp_assoc_update_retran_path(struct sctp_association *asoc)
>  {
> -	struct sctp_transport *t, *next;
> +	struct sctp_transport *t, *next, *unconfirmed;
>  	struct list_head *head = &asoc->peer.transport_addr_list;
>  	struct list_head *pos;
>  
> @@ -1287,7 +1294,7 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
>  	/* Find the next transport in a round-robin fashion. */
>  	t = asoc->peer.retran_path;
>  	pos = &t->transports;
> -	next = NULL;
> +	next = unconfirmed = NULL;
>  
>  	while (1) {
>  		/* Skip the head. */
> @@ -1318,11 +1325,15 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
>  			 */
>  			if (t->state != SCTP_UNCONFIRMED && !next)
>  				next = t;
> +			else if (t->state == SCTP_UNCONFIRMED)
> +				unconfirmed = t;
>  		}
>  	}
>  
>  	if (t)
>  		asoc->peer.retran_path = t;
> +	else if (unconfirmed)
> +		asoc->peer.retran_path = t = unconfirmed;
>  
>  	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
>  				 " %p addr: "

since we can not select unconfirmed transports for retransmission,
this part is not correct. the specification forbids this due to security
issues.
Not sure whether you hit this bug: remove transport and left only
one unconfirmed transport, it may cause oops while retransmit.
I will send other patch to fix it first.

...snip...