ccie18643 / PyTCP

PyTCP is a fully functional TCP/IP stack written in Python. It supports TCP stream-based transport with reliable packet delivery based on a sliding window mechanism and basic congestion control. It also supports IPv6/ICMPv6 protocols with SLAAC address configuration. It operates as a user space program attached to the Linux TAP interface.
GNU General Public License v3.0
344 stars 35 forks source link

Don't reapond to rst with rst #5

Open shoham-b opened 2 years ago

shoham-b commented 2 years ago

Currently, if a packet is sent to a port which is not in stack.sockets, then it is responded with rst.

The issue with such behaviour raises when a rst is received, instead of ignoring it, a rst is sent back (protocols/tcp/phrx.py:89).

This is especially problematic if you put two pytcp instances since they enter an infinite loop.

I'd love to fix that, just opening an issue to open it up for discussion.

ccie18643 commented 2 years ago

Valid point. Something i definitely overlooked. Please feel free to fix. Just make sure you use the PyTCP_2_6 branch. Thank you.