From 63ad3a196b7c6ab8962302d8320e2a7f9d4aef37 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 29 Jul 2013 07:30:46 -0700 Subject: [PATCH] debug build asserts that packet is meant for this device, but non-debug should drop those that aren't. --- xwords4/linux/cursesmain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 23fe6fbda..4b4f9c45f 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -1770,8 +1770,12 @@ cursesGotBuf( void* closure, const XP_U8* buf, XP_U16 len ) XP_U16 seed; rowidFromToken( XP_NTOHL( clientToken ), &ignore, &seed ); XP_ASSERT( seed == comms_getChannelSeed( globals->cGlobals.game.comms ) ); - - gameGotBuf( &globals->cGlobals, XP_TRUE, buf, len ); + if ( seed == comms_getChannelSeed( globals->cGlobals.game.comms ) ) { + gameGotBuf( &globals->cGlobals, XP_TRUE, buf, len ); + } else { + XP_LOGF( "%s: dropping packet; meant for a different device", + __func__ ); + } } static gint