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

Change MacAddr to hold u64 instead of byte array #48

Merged
merged 5 commits into from
Feb 11, 2025
Merged

Change MacAddr to hold u64 instead of byte array #48

merged 5 commits into from
Feb 11, 2025

Conversation

oherrala
Copy link
Member

Compiler probably does this anyway. And this way we can have access to upper two bytes if we want to.

@oherrala oherrala added the hacktoberfest-accepted Accepted for Hacktoberfest label Oct 28, 2022
@oherrala oherrala marked this pull request as ready for review October 28, 2022 09:39
@oherrala oherrala removed the hacktoberfest-accepted Accepted for Hacktoberfest label Feb 5, 2025
@oherrala oherrala force-pushed the u64-macaddr branch 2 times, most recently from 8a54c80 to db4f546 Compare February 5, 2025 10:45
&val.0
impl From<&[u8; 6]> for MacAddr {
fn from(v: &[u8; 6]) -> Self {
let r = (u64::from(v[0]) << 40)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure this works on both little and big endian platforms..

Compiler probably does this anyway. And this way we can have access to
upper two bytes if we want to.
@jtt jtt merged commit 3f40674 into main Feb 11, 2025
23 checks passed
@jtt jtt deleted the u64-macaddr branch February 11, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants