X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=net%2Fsctp%2Foutput.c;h=f875fc3ced5498f012996eaf7d39d4039c149642;hb=88c7664f13bd1a36acb8566b93892a4c58759ac6;hp=cdc5a393676657691a2421b573235fde8318b0f8;hpb=075395d228641646159dae3dd170fa3fc6ff477a;p=linux-2.6-omap-h63xx.git diff --git a/net/sctp/output.c b/net/sctp/output.c index cdc5a393676..f875fc3ced5 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -85,8 +85,8 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet, chunk = sctp_get_ecne_prepend(packet->transport->asoc); /* If there a is a prepend chunk stick it on the list before - * any other chunks get appended. - */ + * any other chunks get appended. + */ if (chunk) sctp_packet_append_chunk(packet, chunk); } @@ -110,8 +110,8 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet, packet->destination_port = dport; INIT_LIST_HEAD(&packet->chunk_list); if (asoc) { - struct sctp_sock *sp = sctp_sk(asoc->base.sk); - overhead = sp->pf->af->net_header_len; + struct sctp_sock *sp = sctp_sk(asoc->base.sk); + overhead = sp->pf->af->net_header_len; } else { overhead = sizeof(struct ipv6hdr); } @@ -442,7 +442,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) * acknowledged or have failed. */ if (!sctp_chunk_is_data(chunk)) - sctp_chunk_free(chunk); + sctp_chunk_free(chunk); } /* Perform final transformation on checksum. */ @@ -528,7 +528,7 @@ err: list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { list_del_init(&chunk->list); if (!sctp_chunk_is_data(chunk)) - sctp_chunk_free(chunk); + sctp_chunk_free(chunk); } goto out; nomem: @@ -633,7 +633,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet, * data will fit or delay in hopes of bundling a full * sized packet. */ - if (len < asoc->pathmtu - packet->overhead) { + if (len < asoc->frag_point) { retval = SCTP_XMIT_NAGLE_DELAY; goto finish; } @@ -645,7 +645,13 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet, /* Keep track of how many bytes are in flight to the receiver. */ asoc->outqueue.outstanding_bytes += datasize; - /* Update our view of the receiver's rwnd. */ + /* Update our view of the receiver's rwnd. Include sk_buff overhead + * while updating peer.rwnd so that it reduces the chances of a + * receiver running out of receive buffer space even when receive + * window is still open. This can happen when a sender is sending + * sending small messages. + */ + datasize += sizeof(struct sk_buff); if (datasize < rwnd) rwnd -= datasize; else