diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-19 17:47:36 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-19 17:47:36 -0700 |
commit | fdee3ba82b997c709e6822aa000df8adb61c56a5 (patch) | |
tree | ed566f55ef024fd2a45d053a719010e1b2c49366 /host/usrp_e_utils/usrp-e-loopback.c | |
parent | ee424d797fc37a8c3c2a82a58218bf1e85456226 (diff) | |
parent | 290bb75de236cb53c54bb4599cc2dde924f9800e (diff) | |
download | uhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.tar.gz uhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.tar.bz2 uhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.zip |
Merge branch 'master' into next
Conflicts:
fpga/usrp2/top/u2plus/Makefile.N200
Diffstat (limited to 'host/usrp_e_utils/usrp-e-loopback.c')
-rw-r--r-- | host/usrp_e_utils/usrp-e-loopback.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/host/usrp_e_utils/usrp-e-loopback.c b/host/usrp_e_utils/usrp-e-loopback.c index 78e2b5d16..0bd3d3100 100644 --- a/host/usrp_e_utils/usrp-e-loopback.c +++ b/host/usrp_e_utils/usrp-e-loopback.c @@ -38,11 +38,15 @@ static int calc_checksum(struct pkt *p) i = 0; sum = 0; - for (i=0; i < p->len; i++) - sum += p->data[i]; - - sum += p->seq_num; - sum += p->len; + if (p->len < 1016) { + for (i=0; i < p->len; i++) + sum += p->data[i]; + + sum += p->seq_num; + sum += p->len; + } else { + printf("Bad packet length = %d received.\n", p->len); + } return sum; } |