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

Fix build on architectures with unsigned char #561

Merged
merged 1 commit into from Apr 25, 2022
Merged

Fix build on architectures with unsigned char #561

merged 1 commit into from Apr 25, 2022

Conversation

pkubaj
Copy link
Contributor

@pkubaj pkubaj commented Apr 25, 2022

ARM and POWER are affected.

@stappersg
Copy link
Contributor

(Summary: the proposed patch did get human attention)

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c as libc::c_char;

It is the libc:: that makes me wonder if that will block using libpnet in a no_std environment.

Would like to known if

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c as c_char;

or even

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c;

will compile (will work) on ARM and/of POWERPC.

(Feel free to render this comment as just noise.)

@pkubaj
Copy link
Contributor Author

pkubaj commented Apr 25, 2022

(Summary: the proposed patch did get human attention)

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c as libc::c_char;

It is the libc:: that makes me wonder if that will block using libpnet in a no_std environment.

Would like to known if

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c as c_char;

error[E0412]: cannot find type c_char in this scope

or even

-        iface.ifr_name[i] = c as i8;
+        iface.ifr_name[i] = c;

That indeed seems to work.

will compile (will work) on ARM and/of POWERPC.

(Feel free to render this comment as just noise.)

@infosechoudini
Copy link

can we push a new commit that doesnt have c_char?

@infosechoudini
Copy link

in the future, we'll look into other methods of building cross-os and cross-arch

@mrmonday mrmonday merged commit ce67226 into libpnet:master Apr 25, 2022
@mrmonday
Copy link
Contributor

Looks good thanks!

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.

None yet

4 participants