Add DEBUG_DATAGRAM_OVERFLOW to support ec_domain_finish datagram overflow testing
authorDave Page <dave.page@gleeble.com>
Tue, 07 Apr 2015 21:25:43 -0400
changeset 2615 bc34e2303fd6
parent 2614 9b29d7bfa230
child 2616 f99e5b11806c
Add DEBUG_DATAGRAM_OVERFLOW to support ec_domain_finish datagram overflow testing
master/globals.h
--- a/master/globals.h	Tue Apr 07 21:07:16 2015 -0400
+++ b/master/globals.h	Tue Apr 07 21:25:43 2015 -0400
@@ -88,8 +88,14 @@
 #define EC_ADDR_LEN 4
 
 /** Resulting maximum data size of a single datagram in a frame. */
+#ifdef DEBUG_DATAGRAM_OVERFLOW
+// Define a runt datagram which can be easily overflowed on 
+// available hardware for use when testing ec_domain_finish()
+#define EC_MAX_DATA_SIZE (128)
+#else
 #define EC_MAX_DATA_SIZE (ETH_DATA_LEN - EC_FRAME_HEADER_SIZE \
                           - EC_DATAGRAM_HEADER_SIZE - EC_DATAGRAM_FOOTER_SIZE)
+#endif // DEBUG_DATAGRAM_OVERFLOW
 
 /** Mailbox header size.  */
 #define EC_MBOX_HEADER_SIZE 6