-
Notifications
You must be signed in to change notification settings - Fork 449
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
Prefer ipv4 for default_gateway over ipv6 on windows #1231
Prefer ipv4 for default_gateway over ipv6 on windows #1231
Conversation
d894697
to
34fa857
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.
|
||
# it "Failed example !!!" do | ||
# expect(plugin.favored_ip).to eq('b') | ||
# end |
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.
Unless there is a compelling reason to keep this, we should remove the commented out example.
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.
Sorry. That was a typo. Removing.
34fa857
to
4c825be
Compare
lib/ohai/plugins/windows/network.rb
Outdated
@@ -53,6 +53,42 @@ def msft_adapter_data | |||
data | |||
end | |||
|
|||
# Returns the interface code in Hexadecimal Format |
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.
YARD format would be helpful here in the future
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've updated them. Could you please take a look.
Thanks
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.
Can you go back and update the method comments to be in YARD format so we can get proper documentation in websites that use YARD.
- Minor fix to select default_interface based on the least metric value - Fix to prefer default_fateway in IPV4 Format - DRY-UP to get interface_code - Commented as per YARD format - Added test cases - Fixes: MSYS-875 Signed-off-by: Nimesh <[email protected]>
4c825be
to
a908f9f
Compare
Thanks for the comments @Nimesh-Msys |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Signed-off-by: Nimesh [email protected]
Description
According to previous logic, there was an iteration over all the interfaces and the value of
default_gateway
anddefault_interface
was getting reset in each loop. Hence the last interface was chosen as default_interface and so its default_gateway.default_gateway
was selected as the first one out from the list ofdefault_ip_gateway
of an interface, hence there was a possibility that if this list contain IPV6 address at former place, then it was selected.In case of multiple Interfaces, priority for
default_interface
should be given to the interface with least metric value. Also, we need to preferIPV4
value ofdefault_gateway
overIPV6
Issues Resolved
#746
Check List