aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/outqueue.c
diff options
context:
space:
mode:
authorMichio Honda <micchie@sfc.wide.ad.jp>2011-04-26 07:19:36 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-02 05:04:53 -0400
commit8a07eb0a50aebc8c95478d49c28c7f8419a26cef (patch)
treea98ab91189d1dd0781d7768c0b0d395c1919d571 /net/sctp/outqueue.c
parent7dc04d712203eecdc1435a4cd135935c4a297be5 (diff)
sctp: Add ASCONF operation 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. In this case, the ASCONF chunk is added to the beginning of the queue, because the other chunks cannot be transmitted in this state. Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r--net/sctp/outqueue.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 1c88c8911dc5..edc753297a49 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -754,6 +754,16 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
754 */ 754 */
755 755
756 list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) { 756 list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
757 /* RFC 5061, 5.3
758 * F1) This means that until such time as the ASCONF
759 * containing the add is acknowledged, the sender MUST
760 * NOT use the new IP address as a source for ANY SCTP
761 * packet except on carrying an ASCONF Chunk.
762 */
763 if (asoc->src_out_of_asoc_ok &&
764 chunk->chunk_hdr->type != SCTP_CID_ASCONF)
765 continue;
766
757 list_del_init(&chunk->list); 767 list_del_init(&chunk->list);
758 768
759 /* Pick the right transport to use. */ 769 /* Pick the right transport to use. */
@@ -881,6 +891,9 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
881 } 891 }
882 } 892 }
883 893
894 if (q->asoc->src_out_of_asoc_ok)
895 goto sctp_flush_out;
896
884 /* Is it OK to send data chunks? */ 897 /* Is it OK to send data chunks? */
885 switch (asoc->state) { 898 switch (asoc->state) {
886 case SCTP_STATE_COOKIE_ECHOED: 899 case SCTP_STATE_COOKIE_ECHOED: