feat: set source address if remote is known - #289
Open
winter4j wants to merge 1 commit into
Open
Conversation
Author
|
补充:上述场景中,发送方在两次连接中本机port相同。即先disconnect释放了port,然后在下一次连接中复用了该port。 |
Owner
|
如果实时设定,比较担心会不会出现连接被中间人劫持的情况。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
当已知remote addr时(即UDPSession的remote字段被有效赋值),建议在readloop中直接设置src。
避免当同一个发送方在多次断连(disconnect)后建连的场景下,接收到上一次连接中远端(ip1)发来的包(可能因为网络波动等原因),导致readloop中src被脏写入,进一步导致后续真正的远端(ip2)的incoming包永远无法被处理。