-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adds support for Unique Local Addresses #2856
Conversation
2d4245b
to
7cb4809
Compare
7cb4809
to
9aa9ac4
Compare
Codecov Report
@@ Coverage Diff @@
## master #2856 +/- ##
==========================================
+ Coverage 88.15% 88.19% +0.03%
==========================================
Files 254 254
Lines 54240 54246 +6
==========================================
+ Hits 47817 47841 +24
+ Misses 6423 6405 -18
|
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.
I'll let @guedou review it but it looks fine to me ! Thanks for the PR
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.
Thanks for this really difficult PR! I think that only in6_getAddrType() should be changed.
@@ -783,12 +779,14 @@ def in6_getscope(addr): | |||
""" | |||
Returns the scope of the address. | |||
""" | |||
if in6_isgladdr(addr) or in6_isuladdr(addr): | |||
if in6_isgladdr(addr): |
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.
According to https://tools.ietf.org/html/rfc4193#section-3.3 the scope is global. This function should not be modified.
addrType = (IPV6_ADDR_UNICAST | IPV6_ADDR_GLOBAL) | ||
if naddr[:2] == b' \x02': # Mark 6to4 @ | ||
if in6_isaddr6to4(addr): # Mark 6to4 |
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.
Please replace @ with address instead of removing it.
@@ -164,29 +167,27 @@ def rfc3484_cmp(source_a, source_b): | |||
return candidate_set[0] | |||
|
|||
|
|||
# Think before modify it : for instance, FE::1 does exist and is unicast | |||
# there are many others like that. | |||
# TODO : integrate Unique Local Addresses |
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.
Do not remove the other comments.
addrType = (IPV6_ADDR_UNICAST | IPV6_ADDR_LINKLOCAL) | ||
elif in6_isuladdr(addr): | ||
addrType = (IPV6_ADDR_UNICAST | IPV6_ADDR_UNIQUE_LOCAL) |
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.
It should also be IPV6_ADDR_GLOBAL
@@ -59,12 +60,14 @@ def cset_sort(x, y): | |||
return -res | |||
|
|||
cset = [] | |||
if in6_isgladdr(addr) or in6_isuladdr(addr): |
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.
I am not convinced that this change is correct. Did you test it on Linux with unique local addresses? It seems that the Linux kernel does not specify IPV6_ADDR_UNIQUE_LOCAL. Therefore, this patch will likely break address selection.
I am closing this PR as we did not receive an answer, and that I doubt that it works correctly. |
As suggested in #399, this PR adds support for detecting Unique Local Addresses.