Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: webrtc/p2p/base/pseudotcp.cc

Issue 2640173002: Fix PseudoTcp to handle incoming packets with invalid SEQ field (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/pseudotcp.cc
diff --git a/webrtc/p2p/base/pseudotcp.cc b/webrtc/p2p/base/pseudotcp.cc
index ec302d3520423fa7ad1f95971feb950f6e37765d..f87c7a75ac475e90d8dec07257b852be4f1fd444 100644
--- a/webrtc/p2p/base/pseudotcp.cc
+++ b/webrtc/p2p/base/pseudotcp.cc
@@ -910,10 +910,14 @@ bool PseudoTcp::process(Segment& seg) {
} else {
uint32_t nOffset = seg.seq - m_rcv_nxt;
- rtc::StreamResult result = m_rbuf.WriteOffset(seg.data, seg.len,
- nOffset, NULL);
+ rtc::StreamResult result =
+ m_rbuf.WriteOffset(seg.data, seg.len, nOffset, NULL);
+ if (result == rtc::SR_BLOCK) {
+ // Ignore incoming packets outside of the receive window.
+ return false;
+ }
+
RTC_DCHECK(result == rtc::SR_SUCCESS);
- RTC_UNUSED(result);
if (seg.seq == m_rcv_nxt) {
m_rbuf.ConsumeWriteBuffer(seg.len);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698