-
Notifications
You must be signed in to change notification settings - Fork 20
common/authenticator: Fix compiler issues with missing endian.h include #33
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
Conversation
This commit brings in 2 missing endian.h includes to support the be16toh() call Without this patch, the following compiler errors occur: In file included from ./common/memutils.h:17, from common/authenticator/authenticator.c:31: common/authenticator/authenticator.c: In function ‘auth_send_eapol’: common/authenticator/authenticator.c:447:68: warning: implicit declaration of function ‘be16toh’ [-Wimplicit-function-declaration] 447 | val_to_str(hdr->packet_type, eapol_frames, "[UNK]"), be16toh(hdr->packet_body_length)); | ^~~~~~~ common/authenticator/authenticator_eap.c: In function ‘auth_eap_recv’: common/authenticator/authenticator_eap.c:325:9: warning: implicit declaration of function ‘be16toh’ [-Wimplicit-function-declaration] 325 | if (be16toh(eap->length) > buf_len) { | ^~~~~~~ Per man endian(3), the be16toh() #define is in <endian.h>
Hello, this is the second time that we seem to have triggered this warning on your end without being detected on our side. I want to understand why this happens, have you made any modification to the sources? For example, under normal circumstances, #include "authenticator.h"
#include "common/eapol.h"
#include "common/endian.h"
#include <endian.h> I am suspecting some name conflict between our local |
Hi @MathisMARION, Looking at the current sources for common/endian.h, I do not see an include of the system <endian.h> in the file. As a test, I went ahead and added:
to the "common/endian.h" file below the include of <stdint.h> And then removed my merge request patch here. As for modifications to the source, we just make extremely minor changes, (adding ubus support instead of dbus), as well as just cross-compiling the sources for ARM on a cross compiler package based on a musleabi toolchain. |
You are correct, I got confused, On my host (Debian testing), the system |
Out of curiosity, what version of libc are you using? |
Hi @MathisMARION : I think this is what you asking for? (Taken from our ARM product):
|
Thank you. We managed to reproduce your issue by building on Alpine which also uses musl libc. We will add a CI job to compile against musl to prevent any future issues. Your patch has been applied to our internal development and will be released as part of v2.7. Thank you again for the report. |
This commit brings in 2 missing endian.h includes to support the be16toh() call Without this patch, the following compiler errors occur: In file included from ./common/memutils.h:17, from common/authenticator/authenticator.c:31: common/authenticator/authenticator.c: In function ‘auth_send_eapol’: common/authenticator/authenticator.c:447:68: warning: implicit declaration of function ‘be16toh’ [-Wimplicit-function-declaration] 447 | val_to_str(hdr->packet_type, eapol_frames, "[UNK]"), be16toh(hdr->packet_body_length)); | ^~~~~~~ common/authenticator/authenticator_eap.c: In function ‘auth_eap_recv’: common/authenticator/authenticator_eap.c:325:9: warning: implicit declaration of function ‘be16toh’ [-Wimplicit-function-declaration] 325 | if (be16toh(eap->length) > buf_len) { | ^~~~~~~ Per man endian(3), the be16toh() #define is in <endian.h> Origin: #33
This commit brings in 2 missing endian.h includes to support the be16toh() call
Without this patch, the following compiler errors occur:
Per man endian(3), the be16toh() #define is in <endian.h>