diff --git a/QnetITAP.cpp b/QnetITAP.cpp index e48a582..30170c6 100644 --- a/QnetITAP.cpp +++ b/QnetITAP.cpp @@ -360,8 +360,13 @@ bool CQnetITAP::ProcessGateway(const int len, const unsigned char *raw) itap.length = 41U; itap.type = 0x20; memcpy(itap.header.flag, dstr.vpkt.hdr.flag, 3); - memcpy(itap.header.r1, dstr.vpkt.hdr.r1, 8); - memcpy(itap.header.r2, dstr.vpkt.hdr.r2, 8); + if (RPTR_MOD == dstar.vpkt.hdr.r2[7]) { + memcpy(itap.header.r1, dstr.vpkt.hdr.r2, 8); + memcpy(itap.header.r2, dstr.vpkt.hdr.r1, 8); + } else { + memcpy(itap.header.r1, dstr.vpkt.hdr.r1, 8); + memcpy(itap.header.r2, dstr.vpkt.hdr.r2, 8); + } memcpy(itap.header.ur, dstr.vpkt.hdr.ur, 8); memcpy(itap.header.my, dstr.vpkt.hdr.my, 8); memcpy(itap.header.nm, dstr.vpkt.hdr.nm, 4);