-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed IPv4 to IPv6 mapping in CIPAddress::pton(..) #1664
Fixed IPv4 to IPv6 mapping in CIPAddress::pton(..) #1664
Conversation
542fe30
to
c199270
Compare
TestIPv6.v4_calls_v6_mappedListener# On HS Conclusion Request:
# CUDT::acceptAndRespond(..)
agent_family: IPv6 (m_SelfAddr.family)
peer: "::ffff:127.0.0.1:64888"
ip[4]: 16777343, 0, 0, 0
# After CIPAddress::pton():
m_SelfAddr: "::ffff:127.0.0.1:4200"
# CIPAddress::ntop(peer, (w_hs.m_piPeerIP));
# Goes to HS Conclusion Response
w_hs.m_piPeerIP[4]: 0, 0, 0xFF, 16777343 Caller# On HS Conclusion Response:
# CUDT::postConnect(..)
m_SelfAddr.family() (agent_family): IPv4 (AF_INET)
ip[4]: 0, 0, 0xFF, 16777343
peer: "127.0.0.1:4200"
Resulting m_SelfAddr: "0.0.0.0:52872" |
TestIPv6.v6_calls_v4Caller Sends HS Induction RequestPeer IP Address[4]: 0, 0, 0xFF, 16777343 Listener Sends HS Induction Response:Peer IP Address[4]: 0, 0, 0xFF, 16777343 Caller Sends HS Conclusion RequestPeer IP Address[4]: 0, 0, 0xFF, 16777343 Listener Sends HS Conclusion Response ❗Peer IP Address[4]: 16777343, 0, 0xFF, 16777343 |
srtcore/common.cpp
Outdated
|
||
bool is_mapped_ipv4 = (std::mismatch(mbegin, mend, peeraddr16).first == mend); | ||
bool is_mapped_ipv4 = (std::mismatch(mbegin, mend, peeraddr16).first == mend); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bool is_mapped_ipv4 = std::equal(mbegin, mend, peeraddr16);
Codecov Report
@@ Coverage Diff @@
## master #1664 +/- ##
==========================================
+ Coverage 60.37% 60.63% +0.26%
==========================================
Files 77 78 +1
Lines 17389 17436 +47
==========================================
+ Hits 10498 10572 +74
+ Misses 6891 6864 -27
Continue to review full report at Codecov.
|
0793123
to
456a498
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes
Co-authored-by: Maxim Sharabayko <maxsharabayko@haivision.com> Co-authored-by: Mathieu Poux <mathieu.poux@gmail.com>
a2b5eb3
to
445ce20
Compare
445ce20
to
d09ea96
Compare
Due to CI failures, IPv6 connection tests were extracted to PR #1670 for further fixes, while the bug fix can go within this PR. |
While converting IPv4 mapped to IPv6 there was an error in the IPv4 index.
Fixes #1663
Added unit test for the case.
TODO
CIPAddress::pton(..)