View | Details | Raw Unified | Return to bug 818
Collapse All | Expand All

(-)a/src/internet-stack/tcp-socket-impl.cc (-2 / +30 lines)
 Lines 79-84    Link Here 
79
    m_closeRequestNotified (false),
79
    m_closeRequestNotified (false),
80
    m_closeOnEmpty (false),
80
    m_closeOnEmpty (false),
81
    m_pendingClose (false),
81
    m_pendingClose (false),
82
    m_finAckRcvd (false),
82
    m_nextTxSequence (0),
83
    m_nextTxSequence (0),
83
    m_highTxMark (0),
84
    m_highTxMark (0),
84
    m_highestRxAck (0),
85
    m_highestRxAck (0),
 Lines 116-121    Link Here 
116
    m_closeRequestNotified (sock.m_closeRequestNotified),
117
    m_closeRequestNotified (sock.m_closeRequestNotified),
117
    m_closeOnEmpty (sock.m_closeOnEmpty),
118
    m_closeOnEmpty (sock.m_closeOnEmpty),
118
    m_pendingClose (sock.m_pendingClose),
119
    m_pendingClose (sock.m_pendingClose),
120
    m_finAckRcvd (sock.m_finAckRcvd),
119
    m_nextTxSequence (sock.m_nextTxSequence),
121
    m_nextTxSequence (sock.m_nextTxSequence),
120
    m_highTxMark (sock.m_highTxMark),
122
    m_highTxMark (sock.m_highTxMark),
121
    m_highestRxAck (sock.m_highestRxAck),
123
    m_highestRxAck (sock.m_highestRxAck),
 Lines 700-705    Link Here 
700
  m_rxWindowSize = tcpHeader.GetWindowSize (); //update the flow control window
702
  m_rxWindowSize = tcpHeader.GetWindowSize (); //update the flow control window
701
703
702
  Events_t event = SimulationSingleton<TcpStateMachine>::Get ()->FlagsEvent (tcpHeader.GetFlags () );
704
  Events_t event = SimulationSingleton<TcpStateMachine>::Get ()->FlagsEvent (tcpHeader.GetFlags () );
705
706
  if ((m_state == FIN_WAIT_1 || m_state == LAST_ACK) && event == ACK_RX)
707
    {
708
      if (tcpHeader.GetSequenceNumber () == m_nextRxSequence)
709
        {
710
          m_finAckRcvd = true;
711
        }
712
    }
713
703
  Actions_t action = ProcessEvent (event); //updates the state
714
  Actions_t action = ProcessEvent (event); //updates the state
704
  NS_LOG_DEBUG("Socket " << this << 
715
  NS_LOG_DEBUG("Socket " << this << 
705
               " processing pkt action, " << action <<
716
               " processing pkt action, " << action <<
 Lines 719-725    Link Here 
719
730
720
  bool needCloseNotify = (stateAction.state == CLOSED && m_state != CLOSED 
731
  bool needCloseNotify = (stateAction.state == CLOSED && m_state != CLOSED 
721
    && e != TIMEOUT);
732
    && e != TIMEOUT);
722
  m_state = stateAction.state;
733
  if (m_state == FIN_WAIT_1 && stateAction.state == FIN_WAIT_2)
734
    {
735
      if (m_finAckRcvd == true)
736
        {
737
          m_state = stateAction.state;
738
        }
739
    }
740
  else if (m_state == LAST_ACK && stateAction.state == CLOSED)
741
    {
742
      if (m_finAckRcvd == true)
743
        {
744
          m_state = stateAction.state;
745
        }
746
    }
747
  else
748
    {
749
      m_state = stateAction.state;
750
    }
723
  NS_LOG_LOGIC ("TcpSocketImpl " << this << " moved from state " << saveState 
751
  NS_LOG_LOGIC ("TcpSocketImpl " << this << " moved from state " << saveState 
724
    << " to state " <<m_state);
752
    << " to state " <<m_state);
725
  NS_LOG_LOGIC ("TcpSocketImpl " << this << " pendingData " << m_pendingData);
753
  NS_LOG_LOGIC ("TcpSocketImpl " << this << " pendingData " << m_pendingData);
 Lines 1640-1646    Link Here 
1640
void TcpSocketImpl::Retransmit ()
1668
void TcpSocketImpl::Retransmit ()
1641
{
1669
{
1642
  NS_LOG_FUNCTION (this);
1670
  NS_LOG_FUNCTION (this);
1643
  uint8_t flags = TcpHeader::NONE;
1671
  uint8_t flags = TcpHeader::ACK;
1644
  if (m_state == SYN_SENT) 
1672
  if (m_state == SYN_SENT) 
1645
    {
1673
    {
1646
      if (m_cnCount > 0) 
1674
      if (m_cnCount > 0) 
(-)a/src/internet-stack/tcp-socket-impl.h (+1 lines)
 Lines 191-196    Link Here 
191
  bool m_closeRequestNotified;
191
  bool m_closeRequestNotified;
192
  bool m_closeOnEmpty;
192
  bool m_closeOnEmpty;
193
  bool m_pendingClose;
193
  bool m_pendingClose;
194
  bool m_finAckRcvd;
194
195
195
  
196
  
196
  //sequence info, sender side
197
  //sequence info, sender side

Return to bug 818