udp_proxy: also drop messages from the last flight

This commit is contained in:
Manuel Pégourié-Gonnard 2014-09-23 10:01:06 +02:00 committed by Paul Bakker
parent abf16240dd
commit ae8d2399a5

View File

@ -88,7 +88,7 @@ int main( void )
" duplicate about 1:N packets randomly\n" \ " duplicate about 1:N packets randomly\n" \
" delay=%%d default: 0 (no delayed packets)\n" \ " delay=%%d default: 0 (no delayed packets)\n" \
" delay about 1:N packets randomly\n" \ " delay about 1:N packets randomly\n" \
" delay_ccs=%%d default: 0 (don't delay ChangeCipherSuite)\n" \ " delay_ccs=%%d default: 0 (don't delay ChangeCipherSpec)\n" \
" drop=%%d default: 0 (no dropped packets)\n" \ " drop=%%d default: 0 (no dropped packets)\n" \
" drop about 1:N packets randomly\n" \ " drop about 1:N packets randomly\n" \
" mtu=%%d default: 0 (unlimited)\n" \ " mtu=%%d default: 0 (unlimited)\n" \
@ -351,9 +351,6 @@ int handle_message( const char *way, int dst, int src )
cur.len > (unsigned) opt.mtu ) || cur.len > (unsigned) opt.mtu ) ||
( opt.drop != 0 && ( opt.drop != 0 &&
strcmp( cur.type, "ApplicationData" ) != 0 && strcmp( cur.type, "ApplicationData" ) != 0 &&
strcmp( cur.type, "NewSessionTicket" ) != 0 && // temporary
strcmp( cur.type, "ChangeCipherSpec" ) != 0 && // temporary
strcmp( cur.type, "Unknown handshake" ) != 0 && // temporary
rand() % opt.drop == 0 ) ) rand() % opt.drop == 0 ) )
{ {
; /* Nothing to do */ ; /* Nothing to do */
@ -362,9 +359,6 @@ int handle_message( const char *way, int dst, int src )
strcmp( cur.type, "ChangeCipherSpec" ) == 0 ) || strcmp( cur.type, "ChangeCipherSpec" ) == 0 ) ||
( opt.delay != 0 && ( opt.delay != 0 &&
strcmp( cur.type, "ApplicationData" ) != 0 && strcmp( cur.type, "ApplicationData" ) != 0 &&
strcmp( cur.type, "NewSessionTicket" ) != 0 && // temporary
strcmp( cur.type, "ChangeCipherSpec" ) != 0 && // temporary
strcmp( cur.type, "Unknown handshake" ) != 0 && // temporary
rand() % opt.delay == 0 ) ) rand() % opt.delay == 0 ) )
{ {
memcpy( &prev, &cur, sizeof( packet ) ); memcpy( &prev, &cur, sizeof( packet ) );