Fixed aligment issue in cmp_clock (indirectly caused by increasing padding in csp-buffer by 2 bytes to make it correctly aligned).
@@ -141,19 +141,20 @@ static int do_cmp_poke(struct csp_cmp_message *cmp) {
static int do_cmp_clock(struct csp_cmp_message *cmp) {
- cmp->clock.tv_sec = csp_ntoh32(cmp->clock.tv_sec);
- cmp->clock.tv_nsec = csp_ntoh32(cmp->clock.tv_nsec);
+ csp_timestamp_t clock;
+ clock.tv_sec = csp_ntoh32(cmp->clock.tv_sec);
+ clock.tv_nsec = csp_ntoh32(cmp->clock.tv_nsec);
- if ((cmp->clock.tv_sec != 0) && (clock_set_time != NULL)) {
- clock_set_time(&cmp->clock);
+ if ((clock.tv_sec != 0) && (clock_set_time != NULL)) {
+ clock_set_time(&clock);
}
if (clock_get_time != NULL) {
- clock_get_time(&cmp->clock);
+ clock_get_time(&clock);
}
- cmp->clock.tv_sec = csp_hton32(cmp->clock.tv_sec);
- cmp->clock.tv_nsec = csp_hton32(cmp->clock.tv_nsec);
+ cmp->clock.tv_sec = csp_hton32(clock.tv_sec);
+ cmp->clock.tv_nsec = csp_hton32(clock.tv_nsec);
return CSP_ERR_NONE;
}
