Skip to content
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

WIP: Fix detection of mac address on IPv6 systems #689

Closed
wants to merge 3 commits into from

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Dec 18, 2015

We failed to detect the mac address when lo has ipv4/ipv6, but all other interfaces only have ipv6. This is just a simplified version of Phil's code from #685 with specs added.

else
ip6address route[:src]
end
else
macaddress iface[default_route[:dev]][:addresses].select{|k,v| v["family"]=="lladdr"}.first.first unless iface[default_route[:dev]][:flags].include? "NOARP"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the event routes were found, this won't fill in mac addr, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget this.

@jaymzh
Copy link
Collaborator

jaymzh commented Dec 21, 2015

Ping?

@tas50
Copy link
Contributor Author

tas50 commented Dec 21, 2015

Sorry @jaymzh I've been out with the flu. Still recoverying

unless route.nil? or route.empty?

if route && !route.empty?
macaddress iface[route[:dev]][:addresses].select{|k,v| v["family"]=="lladdr"}.first.first unless iface[route[:dev]][:flags].include? "NOARP"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but ftr, if you have v4 and v6 routes that match, v6 will win since it's done second.

@tas50
Copy link
Contributor Author

tas50 commented Dec 23, 2015

Closing this out since @btm picked up the slack from my deathly illness and finished this.

@tas50 tas50 closed this Dec 23, 2015
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants