X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Frmr%2Fsi%2Fsrc%2Fmt_call_si_static.c;h=76b56b21a0f04437ded7c7d157870f9704c05238;hb=05850e0815095c029ecff43ac8e0983f2fba4fb6;hp=fbbffaf8bf7100ddeaf28c385fee6f44678163ab;hpb=fc2112d22bf69b4bfbe0c419ed366f0d0ec370ca;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/mt_call_si_static.c b/src/rmr/si/src/mt_call_si_static.c index fbbffaf..76b56b2 100644 --- a/src/rmr/si/src/mt_call_si_static.c +++ b/src/rmr/si/src/mt_call_si_static.c @@ -110,14 +110,26 @@ static void buf2mbuf( uta_ctx_t* ctx, char *raw_msg, int msg_size, int sender_fd byte order. If is not present, we use . This allows old versions of RMR to continue to work with new versions that now do the right thing with byte ordering. + + If the receiver of a message is a backlevel RMR, and it uses RTS to + return a message, it will only update the old size, but when the + message is received back at a new RMR application it will appear that + the message came from a new instance. Therefore, we must compare + the old and new sizes and if they are different we must use the old + size assuming that this is the case. */ static inline uint32_t extract_mlen( unsigned char* buf ) { uint32_t size; // adjusted (if needed) size for return + uint32_t osize; // old size uint32_t* blen; // length in the buffer to extract blen = (uint32_t *) buf; if( *(buf + sizeof( int ) * 2 ) == TP_SZ_MARKER ) { + osize = *blen; // old size size = ntohl( *(blen+1) ); // pick up the second integer + if( osize != size ) { // assume back level return to sender + size = osize; // MUST use old size + } if( DEBUG > 1 ) rmr_vlog( RMR_VL_DEBUG, "extract msg len converted from net order to: %d\n", size ); } else { size = *blen; // old sender didn't encode size