# HG changeset patch # User Florian Pose # Date 1225879160 0 # Node ID 448f2e9fa483ea39da70d9360d4bea326a4cd2ec # Parent 92a2a3d1bb79d060eb5f3b839609b12f3389c981 Output corrupted frame reasons. diff -r 92a2a3d1bb79 -r 448f2e9fa483 master/master.c --- a/master/master.c Tue Oct 28 13:31:20 2008 +0000 +++ b/master/master.c Wed Nov 05 09:59:20 2008 +0000 @@ -750,6 +750,11 @@ ec_datagram_t *datagram; if (unlikely(size < EC_FRAME_HEADER_SIZE)) { + if (master->debug_level) { + EC_DBG("Corrupted frame received (size %u < %u byte):\n", + size, EC_FRAME_HEADER_SIZE); + ec_print_data(frame_data, size); + } master->stats.corrupted++; ec_master_output_stats(master); return; @@ -762,6 +767,11 @@ cur_data += EC_FRAME_HEADER_SIZE; if (unlikely(frame_size > size)) { + if (master->debug_level) { + EC_DBG("Corrupted frame received (invalid frame size %u for " + "received size %u):\n", frame_size, size); + ec_print_data(frame_data, size); + } master->stats.corrupted++; ec_master_output_stats(master); return; @@ -778,6 +788,11 @@ if (unlikely(cur_data - frame_data + data_size + EC_DATAGRAM_FOOTER_SIZE > size)) { + if (master->debug_level) { + EC_DBG("Corrupted frame received (invalid data size %u):\n", + data_size); + ec_print_data(frame_data, size); + } master->stats.corrupted++; ec_master_output_stats(master); return;