aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2006-09-29 20:10:03 -0400
committerDavid S. Miller <davem@davemloft.net>2006-09-29 20:10:03 -0400
commitf236218b7292bccb0f8754a0feb5d9e9a06fe5a2 (patch)
tree3d787eac398a370504d3dd051437dd33099b9d89 /net/sctp/sm_make_chunk.c
parentb56bab46f3220eb6b1f71c000faa44c6b13fb148 (diff)
[SCTP]: Do not timestamp every SCTP packet.
We only need the timestamp on COOKIE-ECHO chunks, so instead of always timestamping every SCTP packet, let common code timestamp if the socket option is set. For COOKIE-ECHO, simply get the time of day if we don't have a timestamp. This introduces a small possibility that the cookie may be considered expired, but it will be renegotiated. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c10
1 files changed, 9 insertions, 1 deletions
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 /*