Skip to content

Commit 2da42de

Browse files
committed
GtpUserX2: added some asserts
1 parent 3a6206d commit 2da42de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/simu5g/corenetwork/gtp/GtpUserX2.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ void GtpUserX2::handleFromStack(Packet *pkt)
6161
{
6262
// extract destination from the message
6363
auto x2Msg = pkt->peekAtFront<LteX2Message>();
64-
X2NodeId destId = MacNodeId(x2Msg->getDestinationId());
65-
X2NodeId srcId = MacNodeId(x2Msg->getSourceId());
64+
X2NodeId destId = x2Msg->getDestinationId();
65+
X2NodeId srcId = x2Msg->getSourceId();
66+
ASSERT(getNodeTypeById(srcId) == ENODEB);
67+
ASSERT(getNodeTypeById(destId) == ENODEB);
68+
ASSERT(srcId != destId);
6669
EV << "GtpUserX2::handleFromStack - Received a LteX2Message with destId[" << destId << "]" << endl;
6770

6871
auto gtpMsg = makeShared<GtpUserMsg>();
@@ -71,6 +74,7 @@ void GtpUserX2::handleFromStack(Packet *pkt)
7174

7275
// get the IP address of the destination X2 interface from the Binder
7376
L3Address peerAddress = binder_->getX2PeerAddress(srcId, destId);
77+
ASSERT(!peerAddress.isUnspecified());
7478
socket_.sendTo(pkt, peerAddress, tunnelPeerPort_);
7579
}
7680

0 commit comments

Comments
 (0)