summaryrefslogtreecommitdiff
path: root/usrp2/firmware
diff options
context:
space:
mode:
authorjcorgan2008-12-31 22:33:47 +0000
committerjcorgan2008-12-31 22:33:47 +0000
commit0ba124e805046f65a7ef275ebe9d8254d8f69ed9 (patch)
treeff8a486d3e221b707b63ab98ec049468734f8e89 /usrp2/firmware
parent5eb35d758f7bf08b821479d11a8784689eef239c (diff)
downloadgnuradio-0ba124e805046f65a7ef275ebe9d8254d8f69ed9.tar.gz
gnuradio-0ba124e805046f65a7ef275ebe9d8254d8f69ed9.tar.bz2
gnuradio-0ba124e805046f65a7ef275ebe9d8254d8f69ed9.zip
Fix USRP2 peek32() max words
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10183 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/firmware')
-rw-r--r--usrp2/firmware/apps/app_common_v2.c3
-rw-r--r--usrp2/firmware/include/usrp2_eth_packet.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c
index 635093fbb..c498d3008 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -340,7 +340,8 @@ peek_cmd(const op_peek_t *p,
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?
}
diff --git a/usrp2/firmware/include/usrp2_eth_packet.h b/usrp2/firmware/include/usrp2_eth_packet.h
index 515394fab..e212fab83 100644
--- a/usrp2/firmware/include/usrp2_eth_packet.h
+++ b/usrp2/firmware/include/usrp2_eth_packet.h
@@ -194,7 +194,7 @@ typedef struct {
* 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