Bug 1304 - (temporary fix) Tag information changed after transmission
This commit is contained in:
@@ -121,9 +121,9 @@ Ipv4PacketInfoTag::Deserialize (TagBuffer i)
|
||||
{
|
||||
uint8_t buf[4];
|
||||
i.Read (buf, 4);
|
||||
m_addr.Deserialize (buf);
|
||||
m_addr = Ipv4Address::Deserialize (buf);
|
||||
i.Read (buf, 4);
|
||||
m_spec_dst.Deserialize (buf);
|
||||
m_spec_dst = Ipv4Address::Deserialize (buf);
|
||||
m_ifindex = i.ReadU32 ();
|
||||
m_ttl = i.ReadU8 ();
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ Ipv6PacketInfoTag::Deserialize (TagBuffer i)
|
||||
{
|
||||
uint8_t buf[16];
|
||||
i.Read (buf, 16);
|
||||
m_addr.Deserialize (buf);
|
||||
m_addr = Ipv6Address::Deserialize (buf);
|
||||
m_ifindex = i.ReadU8 ();
|
||||
m_hoplimit = i.ReadU8 ();
|
||||
m_tclass = i.ReadU8 ();
|
||||
|
||||
@@ -454,7 +454,7 @@ void NscTcpL4Protocol::AddInterface (void)
|
||||
// All we need is another address on the same network as the interface. This
|
||||
// will force the stack to output the packet out of the network interface.
|
||||
addrBytes[3]++;
|
||||
addr.Deserialize (addrBytes);
|
||||
addr = Ipv4Address::Deserialize (addrBytes);
|
||||
addrOss.str ("");
|
||||
addr.Print (addrOss);
|
||||
m_nscStack->add_default_gateway (addrOss.str ().c_str ());
|
||||
|
||||
@@ -497,7 +497,7 @@ void NscTcpSocketImpl::CompleteFork (void)
|
||||
|
||||
if (0 == m_nscTcpSocket->getpeername ((struct sockaddr*) &sin, &sin_len)) {
|
||||
m_remotePort = ntohs (sin.sin_port);
|
||||
m_remoteAddress = m_remoteAddress.Deserialize ((const uint8_t*) &sin.sin_addr);
|
||||
m_remoteAddress = Ipv4Address::Deserialize ((const uint8_t*) &sin.sin_addr);
|
||||
m_peerAddress = InetSocketAddress (m_remoteAddress, m_remotePort);
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ void NscTcpSocketImpl::CompleteFork (void)
|
||||
sin_len = sizeof(sin);
|
||||
|
||||
if (0 == m_nscTcpSocket->getsockname ((struct sockaddr *) &sin, &sin_len))
|
||||
m_localAddress = m_localAddress.Deserialize ((const uint8_t*) &sin.sin_addr);
|
||||
m_localAddress = Ipv4Address::Deserialize ((const uint8_t*) &sin.sin_addr);
|
||||
|
||||
NS_LOG_LOGIC ("NscTcpSocketImpl " << this << " accepted connection from "
|
||||
<< m_remoteAddress << ":" << m_remotePort
|
||||
@@ -529,7 +529,7 @@ void NscTcpSocketImpl::ConnectionSucceeded ()
|
||||
struct sockaddr_in sin;
|
||||
size_t sin_len = sizeof(sin);
|
||||
if (0 == m_nscTcpSocket->getsockname ((struct sockaddr *) &sin, &sin_len)) {
|
||||
m_localAddress = m_localAddress.Deserialize ((const uint8_t*)&sin.sin_addr);
|
||||
m_localAddress = Ipv4Address::Deserialize ((const uint8_t*)&sin.sin_addr);
|
||||
m_localPort = ntohs (sin.sin_port);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user