From 7affdda2f393ebad9c9ff4b7f53d776e079c10fe Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Fri, 29 Sep 2006 17:10:03 -0700 Subject: [PATCH] --- yaml --- r: 37215 b: refs/heads/master c: f236218b7292bccb0f8754a0feb5d9e9a06fe5a2 h: refs/heads/master i: 37213: 36728c97fd906a229aa0afcc43e4aa3570b36123 37211: 765545d759557e482a3d5c77660b95b1574f4016 37207: 9c075e21f8e724865782abd1997ea6e8f3404009 37199: d239d4ec1766b1c57fb409fbd7a205b4e996d209 37183: beeb4250dba616645880328abe8010a636cdd336 v: v3 --- [refs] | 2 +- trunk/net/sctp/input.c | 6 ------ trunk/net/sctp/sm_make_chunk.c | 10 +++++++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4b930bb35c5a..94884a201d4c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b56bab46f3220eb6b1f71c000faa44c6b13fb148 +refs/heads/master: f236218b7292bccb0f8754a0feb5d9e9a06fe5a2 diff --git a/trunk/net/sctp/input.c b/trunk/net/sctp/input.c index 4714882ada96..64f630102532 100644 --- a/trunk/net/sctp/input.c +++ b/trunk/net/sctp/input.c @@ -218,12 +218,6 @@ int sctp_rcv(struct sk_buff *skb) } } - /* SCTP seems to always need a timestamp right now (FIXME) */ - if (skb->tstamp.off_sec == 0) { - __net_timestamp(skb); - sock_enable_timestamp(sk); - } - if (!xfrm_policy_check(sk, XFRM_POLICY_IN, skb, family)) goto discard_release; nf_reset(skb); diff --git a/trunk/net/sctp/sm_make_chunk.c b/trunk/net/sctp/sm_make_chunk.c index 7745bdea7817..507dff72c585 100644 --- a/trunk/net/sctp/sm_make_chunk.c +++ b/trunk/net/sctp/sm_make_chunk.c @@ -1447,8 +1447,16 @@ struct sctp_association *sctp_unpack_cookie( /* Check to see if the cookie is stale. If there is already * an association, there is no need to check cookie's expiration * for init collision case of lost COOKIE ACK. + * If skb has been timestamped, then use the stamp, otherwise + * use current time. This introduces a small possibility that + * that a cookie may be considered expired, but his would only slow + * down the new association establishment instead of every packet. */ - skb_get_timestamp(skb, &tv); + if (sock_flag(ep->base.sk, SOCK_TIMESTAMP)) + skb_get_timestamp(skb, &tv); + else + do_gettimeofday(&tv); + if (!asoc && tv_lt(bear_cookie->expiration, tv)) { __u16 len; /*