Skip to content

Commit 32962b2

Browse files
internet-apps: Fully reset V4TraceRoute output streams on final hop
The final-hop branch in Receive() reset the m_osRoute / m_routeIpv4 string streams with clear() only, which resets the state flags but does not empty the buffer, so stale route text could leak into a subsequent hop's output. Pair str("") with clear(), as every other reset site in the file does.
1 parent 6b7601d commit 32962b2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/internet-apps/model/v4traceroute.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ V4TraceRoute::Receive(Ptr<Socket> socket)
333333
<< " " << m_osRoute.str() << "\n";
334334
}
335335

336+
m_osRoute.str("");
336337
m_osRoute.clear();
338+
m_routeIpv4.str("");
337339
m_routeIpv4.clear();
338340
}
339341
else

0 commit comments

Comments
 (0)