proper M17 lich.dest

unstable
Tom Early 4 years ago
parent b641b74cd8
commit 517c3a218a

@ -252,7 +252,11 @@ void CM17Protocol::HandleQueue(void)
// is this client busy ? // is this client busy ?
if ( !client->IsAMaster() && (client->GetReflectorModule() == module) ) if ( !client->IsAMaster() && (client->GetReflectorModule() == module) )
{ {
// no, send the packet // set the destination
client->GetCallsign().CodeOut(frame.lich.addr_dst);
// set the crc
frame.crc = htons(m17crc.CalcCRC(frame.magic, sizeof(SM17Frame)-2));
// now send the packet
Send(frame, client->GetIp()); Send(frame, client->GetIp());
} }
@ -387,8 +391,7 @@ void CM17Protocol::EncodeM17Packet(SM17Frame &frame, const CDvHeaderPacket &Head
// do the lich structure first // do the lich structure first
// first, the dest and src callsigns // first, the src callsign (the dest will be set HandleQueue)
Header.GetRpt2Callsign().CodeOut(frame.lich.addr_dst);
CCallsign from = g_Reflector.GetCallsign(); CCallsign from = g_Reflector.GetCallsign();
from.SetCSModule(Header.GetPacketModule()); from.SetCSModule(Header.GetPacketModule());
from.CodeOut(frame.lich.addr_src); from.CodeOut(frame.lich.addr_src);
@ -405,6 +408,5 @@ void CM17Protocol::EncodeM17Packet(SM17Frame &frame, const CDvHeaderPacket &Head
frame.framenumber = htons(fn); frame.framenumber = htons(fn);
memcpy(frame.payload, DvFrame.GetCodecData(codec_in), 16); memcpy(frame.payload, DvFrame.GetCodecData(codec_in), 16);
frame.streamid = Header.GetStreamId(); // no host<--->network byte swapping since we never do any math on this value frame.streamid = Header.GetStreamId(); // no host<--->network byte swapping since we never do any math on this value
// finally, calcualte the m17 CRC value and load it // the CRC will be set in HandleQueue, after lich.dest is set
frame.crc = htons(m17crc.CalcCRC(frame.magic, sizeof(SM17Frame)-2));
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.