Output corrupted frame reasons.
--- 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;