From ee0cd3ccca2c2efe4c20436dab567f614b5ba3f4 Mon Sep 17 00:00:00 2001 From: Yutaka Takeda Date: Wed, 15 Jul 2020 01:26:29 -0700 Subject: [PATCH] Validate cookie even in the established state Relates to pion/webrtc#1270 --- association.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/association.go b/association.go index cb2e42d8..88b21dba 100644 --- a/association.go +++ b/association.go @@ -986,7 +986,9 @@ func (a *Association) handleCookieEcho(c *chunkCookieEcho) []*packet { default: return nil case established: - break + if !bytes.Equal(a.myCookie.cookie, c.cookie) { + return nil + } case closed, cookieWait, cookieEchoed: if !bytes.Equal(a.myCookie.cookie, c.cookie) { return nil