On 2017年02月27日 14:53, Hailiang Zhang wrote:
I think the issue is that your code can not differ A from B.


We have a parameter 'fin_ack_seq' recording the sequence of
'FIN=1,ACK=1,seq=w,ack=u+1' and if the ack value from the opposite
side is is 'w+1', we can consider this connection is closed, no ?

Let's see what happens, consider VM is doing active close (reuse the figure above):

(VM)
Client:                                    Server:

ESTABLISHED|                               |
           | -> FIN=1,seq=u   ->           |

handle_secondary():
fin_ack_seq = u
tcp_state = TCPS_LAST_ACK

FIN_WAIT_1 |                               |
           | <- ACK=1,seq=v,ack=u+1 <-     |

handle_primary():
fin_ack_seq = ack + 1
g_hash_table_remove()

But we probably want it to be removed in TIME_WAIT_CLOSED.

Thanks

Reply via email to