Fixed issue with DTLS sliding window implementation (#1370881)

This commit is contained in:
Nikos Mavrogiannopoulos 2016-08-29 13:54:44 +02:00
parent 6ba01df0b3
commit da39dd49b2
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From 3ca24f24d9322256bc4c6d3bd237f8b98f073030 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Mon, 29 Aug 2016 13:02:54 +0200
Subject: [PATCH] dtls: ensure that the DTLS window doesn't get stalled
That is ensure that it is forwarded at least one place if more than 16
packets have been received since the first one.
---
lib/dtls-sw.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/dtls-sw.c b/lib/dtls-sw.c
index 616bd5a..8c334c0 100644
--- a/lib/dtls-sw.c
+++ b/lib/dtls-sw.c
@@ -51,7 +51,15 @@
#define DTLS_WINDOW_MARK(W, S) ((W)->dtls_sw_bits |= ((uint64_t) 1 << DTLS_WINDOW_OFFSET(W, S)))
-#define DTLS_WINDOW_UPDATE(W) while ((W)->dtls_sw_bits & (uint64_t) 1) { \
+/* We forcefully advance the window once we have received more than
+ * 8 packets since the first one. That way we ensure that we don't
+ * get stuck on connections with many lost packets. */
+#define DTLS_WINDOW_UPDATE(W) \
+ if (((W)->dtls_sw_bits & 0xffffffffffff0000LL) != 0) { \
+ (W)->dtls_sw_bits = (W)->dtls_sw_bits >> 1; \
+ (W)->dtls_sw_start++; \
+ } \
+ while ((W)->dtls_sw_bits & (uint64_t) 1) { \
(W)->dtls_sw_bits = (W)->dtls_sw_bits >> 1; \
(W)->dtls_sw_start++; \
}
--
libgit2 0.24.0

View File

@ -37,6 +37,7 @@ Patch1: gnutls-3.2.7-rpath.patch
Patch3: gnutls-3.5.3-nosrp.patch
Patch4: gnutls-3.5.1-default-policy.patch
Patch5: gnutls-3.4.2-no-now-guile.patch
Patch6: gnutls-3.5.3-dtls-fix.patch
# Wildcard bundling exception https://fedorahosted.org/fpc/ticket/174
Provides: bundled(gnulib) = 20130424
@ -140,6 +141,7 @@ This package contains Guile bindings for the library.
%patch3 -p1 -b .nosrp
%patch4 -p1 -b .default-policy
%patch5 -p1 -b .guile
%patch6 -p1 -b .dtls-fix
sed 's/gnutls_srp.c//g' -i lib/Makefile.in
sed 's/gnutls_srp.lo//g' -i lib/Makefile.in
@ -280,6 +282,7 @@ fi
%changelog
* Mon Aug 29 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> 3.5.3-2
- Work around #1371082 for x86
- Fixed issue with DTLS sliding window implementation (#1370881)
* Tue Aug 9 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> 3.5.3-1
- New upstream release