diff options
Diffstat (limited to 'net/sctp/sm_sideeffect.c')
-rw-r--r-- | net/sctp/sm_sideeffect.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 86426aac1600..238adf7978e9 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -931,6 +931,27 @@ static void sctp_cmd_t1_timer_update(struct sctp_association *asoc, | |||
931 | 931 | ||
932 | } | 932 | } |
933 | 933 | ||
934 | /* Send the whole message, chunk by chunk, to the outqueue. | ||
935 | * This way the whole message is queued up and bundling if | ||
936 | * encouraged for small fragments. | ||
937 | */ | ||
938 | static int sctp_cmd_send_msg(struct sctp_association *asoc, | ||
939 | struct sctp_datamsg *msg) | ||
940 | { | ||
941 | struct sctp_chunk *chunk; | ||
942 | int error = 0; | ||
943 | |||
944 | list_for_each_entry(chunk, &msg->chunks, frag_list) { | ||
945 | error = sctp_outq_tail(&asoc->outqueue, chunk); | ||
946 | if (error) | ||
947 | break; | ||
948 | } | ||
949 | |||
950 | return error; | ||
951 | } | ||
952 | |||
953 | |||
954 | |||
934 | /* These three macros allow us to pull the debugging code out of the | 955 | /* These three macros allow us to pull the debugging code out of the |
935 | * main flow of sctp_do_sm() to keep attention focused on the real | 956 | * main flow of sctp_do_sm() to keep attention focused on the real |
936 | * functionality there. | 957 | * functionality there. |
@@ -1575,7 +1596,13 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1575 | case SCTP_CMD_UPDATE_INITTAG: | 1596 | case SCTP_CMD_UPDATE_INITTAG: |
1576 | asoc->peer.i.init_tag = cmd->obj.u32; | 1597 | asoc->peer.i.init_tag = cmd->obj.u32; |
1577 | break; | 1598 | break; |
1578 | 1599 | case SCTP_CMD_SEND_MSG: | |
1600 | if (!asoc->outqueue.cork) { | ||
1601 | sctp_outq_cork(&asoc->outqueue); | ||
1602 | local_cork = 1; | ||
1603 | } | ||
1604 | error = sctp_cmd_send_msg(asoc, cmd->obj.msg); | ||
1605 | break; | ||
1579 | default: | 1606 | default: |
1580 | printk(KERN_WARNING "Impossible command: %u, %p\n", | 1607 | printk(KERN_WARNING "Impossible command: %u, %p\n", |
1581 | cmd->verb, cmd->obj.ptr); | 1608 | cmd->verb, cmd->obj.ptr); |