summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2016-06-17 00:28:16 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-06-20 18:05:05 -0400
commit6b106b7a4a5451ecae953add1f29636d4ec03e50 (patch)
treee1f1330e7cefb909a8dadccbf4c239290f7510fc
parent24eb9cbb30f0d77dba31e9a54b971678700f0ef2 (diff)
downloadlibnice-6b106b7a4a5451ecae953add1f29636d4ec03e50.tar.gz
pseudotcp: accept several FIN segments
This modification allows to gracefully recover from a first corrupted FIN segment.
-rw-r--r--agent/pseudotcp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/agent/pseudotcp.c b/agent/pseudotcp.c
index 3160c34..d57808e 100644
--- a/agent/pseudotcp.c
+++ b/agent/pseudotcp.c
@@ -1829,12 +1829,9 @@ process(PseudoTcpSocket *self, Segment *seg)
/* @received_fin is set when, and only when, all segments preceding the FIN
* have been acknowledged. This is to handle the case where the FIN arrives
* out of order with a preceding data segment. */
- if (seg->flags & FLAG_FIN && priv->rcv_fin == 0) {
+ if (seg->flags & FLAG_FIN) {
priv->rcv_fin = seg->seq;
DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "Setting rcv_fin = %u", priv->rcv_fin);
- } else if (seg->flags & FLAG_FIN && seg->seq != priv->rcv_fin) {
- DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "Second FIN segment received; ignored");
- return FALSE;
}
/* For the moment, FIN segments must not contain data. */