Skip to content

Commit 61f5e61

Browse files
Scott KilauMathisMARION
authored andcommitted
build: fix compiler issues with missing endian.h include
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
1 parent 7f5e9a5 commit 61f5e61

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

common/authenticator/authenticator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define _DEFAULT_SOURCE
1616
#include <netinet/in.h>
1717
#include <inttypes.h>
18+
#include <endian.h>
1819
#include <errno.h>
1920
#include <string.h>
2021

common/authenticator/authenticator_eap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*
1212
* [1]: https://www.silabs.com/about-us/legal/master-software-license-agreement
1313
*/
14+
#include <endian.h>
15+
1416
#include "common/authenticator/authenticator.h"
1517
#include "common/authenticator/authenticator_radius.h"
1618
#include "common/authenticator/authenticator_key.h"

0 commit comments

Comments
 (0)