aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/input.c8
-rw-r--r--net/sctp/output.c10
-rw-r--r--net/sctp/outqueue.c3
-rw-r--r--net/sctp/sm_make_chunk.c10
-rw-r--r--net/sctp/socket.c4
5 files changed, 22 insertions, 13 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 03f65de75d88..64f630102532 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -218,12 +218,6 @@ int sctp_rcv(struct sk_buff *skb)
218 } 218 }
219 } 219 }
220 220
221 /* SCTP seems to always need a timestamp right now (FIXME) */
222 if (skb->tstamp.off_sec == 0) {
223 __net_timestamp(skb);
224 sock_enable_timestamp(sk);
225 }
226
227 if (!xfrm_policy_check(sk, XFRM_POLICY_IN, skb, family)) 221 if (!xfrm_policy_check(sk, XFRM_POLICY_IN, skb, family))
228 goto discard_release; 222 goto discard_release;
229 nf_reset(skb); 223 nf_reset(skb);
@@ -388,7 +382,7 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
388 * pmtu discovery on this transport. 382 * pmtu discovery on this transport.
389 */ 383 */
390 t->pathmtu = SCTP_DEFAULT_MINSEGMENT; 384 t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
391 t->param_flags = (t->param_flags & ~SPP_HB) | 385 t->param_flags = (t->param_flags & ~SPP_PMTUD) |
392 SPP_PMTUD_DISABLE; 386 SPP_PMTUD_DISABLE;
393 } else { 387 } else {
394 t->pathmtu = pmtu; 388 t->pathmtu = pmtu;
diff --git a/net/sctp/output.c b/net/sctp/output.c
index cdc5a3936766..3ef4351dd956 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -633,7 +633,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet,
633 * data will fit or delay in hopes of bundling a full 633 * data will fit or delay in hopes of bundling a full
634 * sized packet. 634 * sized packet.
635 */ 635 */
636 if (len < asoc->pathmtu - packet->overhead) { 636 if (len < asoc->frag_point) {
637 retval = SCTP_XMIT_NAGLE_DELAY; 637 retval = SCTP_XMIT_NAGLE_DELAY;
638 goto finish; 638 goto finish;
639 } 639 }
@@ -645,7 +645,13 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet,
645 /* Keep track of how many bytes are in flight to the receiver. */ 645 /* Keep track of how many bytes are in flight to the receiver. */
646 asoc->outqueue.outstanding_bytes += datasize; 646 asoc->outqueue.outstanding_bytes += datasize;
647 647
648 /* Update our view of the receiver's rwnd. */ 648 /* Update our view of the receiver's rwnd. Include sk_buff overhead
649 * while updating peer.rwnd so that it reduces the chances of a
650 * receiver running out of receive buffer space even when receive
651 * window is still open. This can happen when a sender is sending
652 * sending small messages.
653 */
654 datasize += sizeof(struct sk_buff);
649 if (datasize < rwnd) 655 if (datasize < rwnd)
650 rwnd -= datasize; 656 rwnd -= datasize;
651 else 657 else
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 37074a39ecbb..739582415bf6 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -416,7 +416,8 @@ void sctp_retransmit_mark(struct sctp_outq *q,
416 * (Section 7.2.4)), add the data size of those 416 * (Section 7.2.4)), add the data size of those
417 * chunks to the rwnd. 417 * chunks to the rwnd.
418 */ 418 */
419 q->asoc->peer.rwnd += sctp_data_size(chunk); 419 q->asoc->peer.rwnd += (sctp_data_size(chunk) +
420 sizeof(struct sk_buff));
420 q->outstanding_bytes -= sctp_data_size(chunk); 421 q->outstanding_bytes -= sctp_data_size(chunk);
421 transport->flight_size -= sctp_data_size(chunk); 422 transport->flight_size -= sctp_data_size(chunk);
422 423
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 7745bdea7817..507dff72c585 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1447,8 +1447,16 @@ no_hmac:
1447 /* Check to see if the cookie is stale. If there is already 1447 /* Check to see if the cookie is stale. If there is already
1448 * an association, there is no need to check cookie's expiration 1448 * an association, there is no need to check cookie's expiration
1449 * for init collision case of lost COOKIE ACK. 1449 * for init collision case of lost COOKIE ACK.
1450 * If skb has been timestamped, then use the stamp, otherwise
1451 * use current time. This introduces a small possibility that
1452 * that a cookie may be considered expired, but his would only slow
1453 * down the new association establishment instead of every packet.
1450 */ 1454 */
1451 skb_get_timestamp(skb, &tv); 1455 if (sock_flag(ep->base.sk, SOCK_TIMESTAMP))
1456 skb_get_timestamp(skb, &tv);
1457 else
1458 do_gettimeofday(&tv);
1459
1452 if (!asoc && tv_lt(bear_cookie->expiration, tv)) { 1460 if (!asoc && tv_lt(bear_cookie->expiration, tv)) {
1453 __u16 len; 1461 __u16 len;
1454 /* 1462 /*
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 79c3e072cf28..3fe906d65069 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3084,8 +3084,8 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3084 */ 3084 */
3085 sp->disable_fragments = 0; 3085 sp->disable_fragments = 0;
3086 3086
3087 /* Turn on/off any Nagle-like algorithm. */ 3087 /* Enable Nagle algorithm by default. */
3088 sp->nodelay = 1; 3088 sp->nodelay = 0;
3089 3089
3090 /* Enable by default. */ 3090 /* Enable by default. */
3091 sp->v4mapped = 1; 3091 sp->v4mapped = 1;