Skip to content
Snippets Groups Projects
Commit c912e5b8 authored by John Romein's avatar John Romein
Browse files

BugID: 225

Fix byte order bug for big-endian machines.
parent fcb09619
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <Common/LofarLogger.h> #include <Common/LofarLogger.h>
#include <Common/hexdump.h> #include <Common/hexdump.h>
#include <CS1_InputSection/InputThread.h> #include <CS1_InputSection/InputThread.h>
#include <Common/DataConvert.h>
#include <Common/Timer.h> #include <Common/Timer.h>
#include <Transport/TransportHolder.h> #include <Transport/TransportHolder.h>
#include <Transport/TH_MPI.h> #include <Transport/TH_MPI.h>
...@@ -112,6 +113,11 @@ retry: // until valid packet received ...@@ -112,6 +113,11 @@ retry: // until valid packet received
unsigned seqid = * ((unsigned *) &recvframe[8]); unsigned seqid = * ((unsigned *) &recvframe[8]);
unsigned blockid = * ((unsigned *) &recvframe[12]); unsigned blockid = * ((unsigned *) &recvframe[12]);
#if defined WORDS_BIGENDIAN
seqid = byteSwap(seqid);
blockid = byteSwap(blockid);
#endif
//if the seconds counter is 0xFFFFFFFF, the data cannot be trusted. //if the seconds counter is 0xFFFFFFFF, the data cannot be trusted.
if (seqid == ~0U) { if (seqid == ~0U) {
++ nrPacketsRejected; ++ nrPacketsRejected;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment