From b0fdf9be0147e216532d2bc59335581cfcb08ee5 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 Jun 2018 09:44:23 -0700 Subject: [PATCH] internet: Fix uninitialized value warning --- src/internet/test/tcp-ecn-test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/internet/test/tcp-ecn-test.cc b/src/internet/test/tcp-ecn-test.cc index 0f1a1c10c..2ffed30b0 100644 --- a/src/internet/test/tcp-ecn-test.cc +++ b/src/internet/test/tcp-ecn-test.cc @@ -493,8 +493,12 @@ TcpEcnTest::Tx (const Ptr p, const TcpHeader &h, SocketWho who) if (m_senderSent == 3) { SocketIpTosTag ipTosTag; - p->PeekPacketTag (ipTosTag); - uint16_t ipTos = static_cast (ipTosTag.GetTos ()); + bool found = p->PeekPacketTag (ipTosTag); + uint16_t ipTos = 0; + if (found) + { + ipTos = static_cast (ipTosTag.GetTos ()); + } if (m_testcase == 4 || m_testcase == 6) { NS_TEST_ASSERT_MSG_EQ (ipTos, 0x2, "IP TOS should have ECT set if ECN negotiation between endpoints is successful");