diff --git a/hostapd/driver_test.c b/hostapd/driver_test.c index 20c55834b..619938338 100644 --- a/hostapd/driver_test.c +++ b/hostapd/driver_test.c @@ -139,7 +139,7 @@ static int test_driver_send_eapol(void *priv, const u8 *addr, const u8 *data, memcpy(eth.h_dest, addr, ETH_ALEN); memcpy(eth.h_source, own_addr, ETH_ALEN); - eth.h_proto = htons(ETH_P_EAPOL); + eth.h_proto = host_to_be16(ETH_P_EAPOL); io[0].iov_base = "EAPOL "; io[0].iov_len = 6; @@ -182,7 +182,7 @@ static int test_driver_send_ether(void *priv, const u8 *dst, const u8 *src, memcpy(eth.h_dest, dst, ETH_ALEN); memcpy(eth.h_source, src, ETH_ALEN); - eth.h_proto = htons(proto); + eth.h_proto = host_to_be16(proto); io[0].iov_base = "ETHER "; io[0].iov_len = 6; diff --git a/hostapd/wpa.h b/hostapd/wpa.h index 44cb92d58..d3538443e 100644 --- a/hostapd/wpa.h +++ b/hostapd/wpa.h @@ -27,7 +27,7 @@ struct ft_rrb_frame { u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ u8 packet_type; /* FT_PACKET_REQUEST/FT_PACKET_RESPONSE */ - u16 action_length; /* little endian length of action_frame */ + le16 action_length; /* little endian length of action_frame */ u8 ap_address[ETH_ALEN]; /* * Followed by action_length bytes of FT Action frame (from Category @@ -55,7 +55,7 @@ struct ft_rrb_frame { struct ft_r0kh_r1kh_pull_frame { u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ u8 packet_type; /* FT_PACKET_R0KH_R1KH_PULL */ - u16 data_length; /* little endian length of data (44) */ + le16 data_length; /* little endian length of data (44) */ u8 ap_address[ETH_ALEN]; u8 nonce[16]; @@ -69,7 +69,7 @@ struct ft_r0kh_r1kh_pull_frame { struct ft_r0kh_r1kh_resp_frame { u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ u8 packet_type; /* FT_PACKET_R0KH_R1KH_RESP */ - u16 data_length; /* little endian length of data (76) */ + le16 data_length; /* little endian length of data (76) */ u8 ap_address[ETH_ALEN]; u8 nonce[16]; /* copied from pull */ @@ -84,7 +84,7 @@ struct ft_r0kh_r1kh_resp_frame { struct ft_r0kh_r1kh_push_frame { u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ u8 packet_type; /* FT_PACKET_R0KH_R1KH_PUSH */ - u16 data_length; /* little endian length of data (80) */ + le16 data_length; /* little endian length of data (80) */ u8 ap_address[ETH_ALEN]; /* Encrypted with AES key-wrap */ diff --git a/src/l2_packet/l2_packet.h b/src/l2_packet/l2_packet.h index b4824c5cc..c7b50141e 100644 --- a/src/l2_packet/l2_packet.h +++ b/src/l2_packet/l2_packet.h @@ -38,7 +38,7 @@ struct l2_packet_data; struct l2_ethhdr { u8 h_dest[ETH_ALEN]; u8 h_source[ETH_ALEN]; - u16 h_proto; + be16 h_proto; } STRUCT_PACKED; #ifdef _MSC_VER