commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10183 - in gnuradio/trunk/usrp2/firmware: apps includ


From: jcorgan
Subject: [Commit-gnuradio] r10183 - in gnuradio/trunk/usrp2/firmware: apps include
Date: Wed, 31 Dec 2008 15:33:48 -0700 (MST)

Author: jcorgan
Date: 2008-12-31 15:33:47 -0700 (Wed, 31 Dec 2008)
New Revision: 10183

Modified:
   gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c
   gnuradio/trunk/usrp2/firmware/include/usrp2_eth_packet.h
Log:
Fix USRP2 peek32() max words

Modified: gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c  2008-12-31 22:19:48 UTC 
(rev 10182)
+++ gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c  2008-12-31 22:33:47 UTC 
(rev 10183)
@@ -340,7 +340,8 @@
   putstr("peek: addr="); puthex32(p->addr);
   printf(" bytes=%u\n", p->bytes);
 
-  if (reply_payload_space < (sizeof(*r) + p->bytes)) {
+  if ((reply_payload_space < (sizeof(*r) + p->bytes)) ||
+      p->bytes > MAX_SUBPKT_LEN - sizeof(op_generic_t)) {
     putstr("peek: insufficient reply packet space\n");
     return 0;                  // FIXME do partial read?
   }

Modified: gnuradio/trunk/usrp2/firmware/include/usrp2_eth_packet.h
===================================================================
--- gnuradio/trunk/usrp2/firmware/include/usrp2_eth_packet.h    2008-12-31 
22:19:48 UTC (rev 10182)
+++ gnuradio/trunk/usrp2/firmware/include/usrp2_eth_packet.h    2008-12-31 
22:33:47 UTC (rev 10183)
@@ -194,8 +194,8 @@
  * All subpackets are a multiple of 4 bytes long.
  * All subpackets start with an 8-bit opcode, an 8-bit len and an 8-bit rid.
  */
+#define MAX_SUBPKT_LEN 252
 
-
 /*!
  * \brief Generic request and reply packet
  *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]