aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp_clock/octoclock/octoclock_impl.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-01-23 11:02:15 -0800
committeratrnati <54334261+atrnati@users.noreply.github.com>2020-02-04 08:53:01 -0600
commit4b1d346a80f860ebcf26712b721606c19dd904dd (patch)
tree31ee6a6a42ffdf3623b8695cfa17cec5f8adebf8 /host/lib/usrp_clock/octoclock/octoclock_impl.hpp
parent22db12c4b2b55225801ec1efb2465c7a06295b9e (diff)
downloaduhd-4b1d346a80f860ebcf26712b721606c19dd904dd.tar.gz
uhd-4b1d346a80f860ebcf26712b721606c19dd904dd.tar.bz2
uhd-4b1d346a80f860ebcf26712b721606c19dd904dd.zip
octoclock: Avoid usage of uninitialized memory
The Octoclock host code would send uninitialized memory over the network, which would be flagged by tools such as Valgrind. This patch creates a factory function for OctoClock packets that initializes the memory to zero, defaults the proto version to the OctoClock default, and can provide a random sequence number if none is given.
Diffstat (limited to 'host/lib/usrp_clock/octoclock/octoclock_impl.hpp')
-rw-r--r--host/lib/usrp_clock/octoclock/octoclock_impl.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp
index d293ce3e5..01c1f91eb 100644
--- a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp
+++ b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp
@@ -21,6 +21,11 @@
uhd::device_addrs_t octoclock_find(const uhd::device_addr_t& hint);
+//! Create an empty octoclock packet with a random sequence number
+octoclock_packet_t make_octoclock_packet();
+//! Create an empty octoclock packet with a given sequence number
+octoclock_packet_t make_octoclock_packet(const uint32_t sequence);
+
/*!
* OctoClock implementation guts
*/