summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ratp.c4
-rw-r--r--scripts/remote/ratp.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/ratp.c b/lib/ratp.c
index d3c252047a..c946bea1a5 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -165,7 +165,7 @@ static bool ratp_has_data(struct ratp_header *hdr)
{
if (hdr->control & RATP_CONTROL_SO)
return 1;
- if (hdr->data_length)
+ if (!(hdr->control & (RATP_CONTROL_SYN | RATP_CONTROL_RST | RATP_CONTROL_FIN)) && hdr->data_length)
return 1;
return 0;
}
@@ -1338,7 +1338,7 @@ static int ratp_behaviour_i1(struct ratp_internal *ri, void *pkt)
struct ratp_header *hdr = pkt;
uint8_t control = 0;
- if (!hdr->data_length && !(hdr->control & RATP_CONTROL_SO))
+ if (!ratp_has_data (hdr))
return 1;
pr_vdebug("%s **received** %d\n", __func__, hdr->data_length);
diff --git a/scripts/remote/ratp.py b/scripts/remote/ratp.py
index 079fb871a3..a41d2e8a3f 100644
--- a/scripts/remote/ratp.py
+++ b/scripts/remote/ratp.py
@@ -525,7 +525,7 @@ class RatpConnection(object):
# Our fin was lost, rely on retransmission
return False
- if r.length or r.c_so:
+ if (r.length and not r.c_syn and not r.c_rst and not r.c_fin) or r.c_so:
self._retrans = None
s = RatpPacket(flags='RA')
s.c_sn = r.c_an
@@ -596,7 +596,7 @@ class RatpConnection(object):
if r.c_so:
self._r_sn = r.c_sn
self._rx_buf.append(chr(r.length))
- elif r.length:
+ elif r.length and not r.c_syn and not r.c_rst and not r.c_fin:
self._r_sn = r.c_sn
self._rx_buf.append(r.payload)
else: