Date: Fri, 17 Sep 2010 19:20:39 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212801 - head/sys/netinet Message-ID: <201009171920.o8HJKdbJ039349@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Fri Sep 17 19:20:39 2010 New Revision: 212801 URL: http://svn.freebsd.org/changeset/base/212801 Log: Fix a bug where the wrong PR-SCTP policy was considered. While there, use always the same code for the check of TTL expiration. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_indata.c Fri Sep 17 19:20:39 2010 (r212801) @@ -3300,13 +3300,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (stcb->asoc.peer_supports_prsctp) { if ((PR_SCTP_TTL_ENABLED(tp1->flags)) && tp1->sent < SCTP_DATAGRAM_ACKED) { /* Is it expired? */ - if ( - /* - * TODO sctp_constants.h needs alternative - * time macros when _KERNEL is undefined. - */ - (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) - ) { + if (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) { /* Yes so drop it */ if (tp1->data != NULL) { (void)sctp_release_pr_sctp_chunk(stcb, tp1, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_output.c Fri Sep 17 19:20:39 2010 (r212801) @@ -5728,7 +5728,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, while (chk) { nchk = TAILQ_NEXT(chk, sctp_next); /* Here we must move to the sent queue and mark */ - if (PR_SCTP_TTL_ENABLED(chk->flags)) { + if (PR_SCTP_BUF_ENABLED(chk->flags)) { if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { if (chk->data) { /* Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_timer.c Fri Sep 17 19:20:39 2010 (r212801) @@ -772,9 +772,7 @@ start_again: } if (stcb->asoc.peer_supports_prsctp && PR_SCTP_TTL_ENABLED(chk->flags)) { /* Is it expired? */ - if ((now.tv_sec > chk->rec.data.timetodrop.tv_sec) || - ((chk->rec.data.timetodrop.tv_sec == now.tv_sec) && - (now.tv_usec > chk->rec.data.timetodrop.tv_usec))) { + if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { /* Yes so drop it */ if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009171920.o8HJKdbJ039349>