mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 15:20:42 +01:00
treewide: Prefer flexible arrays to zero-length arrays
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
This commit is contained in:
parent
e0ea324f77
commit
b42923dc5d
@ -73,7 +73,7 @@ struct mschapv2_response {
|
|||||||
/* This will always be sizeof(value) */
|
/* This will always be sizeof(value) */
|
||||||
uint8_t val_length;
|
uint8_t val_length;
|
||||||
struct mschapv2_value value;
|
struct mschapv2_value value;
|
||||||
char name[0];
|
char name[];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
18
src/mpdu.h
18
src/mpdu.h
@ -334,7 +334,7 @@ struct mmpdu_field_capability {
|
|||||||
struct mmpdu_association_request {
|
struct mmpdu_association_request {
|
||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
__le16 listen_interval;
|
__le16 listen_interval;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.6 */
|
/* 802.11, Section 8.3.3.6 */
|
||||||
@ -342,7 +342,7 @@ struct mmpdu_association_response {
|
|||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
__le16 status_code;
|
__le16 status_code;
|
||||||
__le16 aid;
|
__le16 aid;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.7 */
|
/* 802.11, Section 8.3.3.7 */
|
||||||
@ -350,7 +350,7 @@ struct mmpdu_reassociation_request {
|
|||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
__le16 listen_interval;
|
__le16 listen_interval;
|
||||||
unsigned char current_ap_address[6];
|
unsigned char current_ap_address[6];
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.8 */
|
/* 802.11, Section 8.3.3.8 */
|
||||||
@ -358,13 +358,13 @@ struct mmpdu_reassociation_response {
|
|||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
__le16 status_code;
|
__le16 status_code;
|
||||||
__le16 aid;
|
__le16 aid;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.4 */
|
/* 802.11, Section 8.3.3.4 */
|
||||||
struct mmpdu_disassociation {
|
struct mmpdu_disassociation {
|
||||||
__le16 reason_code;
|
__le16 reason_code;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.9 */
|
/* 802.11, Section 8.3.3.9 */
|
||||||
@ -377,14 +377,14 @@ struct mmpdu_probe_response {
|
|||||||
__le64 timestamp;
|
__le64 timestamp;
|
||||||
__le16 beacon_interval;
|
__le16 beacon_interval;
|
||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.15 */
|
/* 802.11, Section 8.3.3.15 */
|
||||||
struct mmpdu_timing_advertisement {
|
struct mmpdu_timing_advertisement {
|
||||||
__le64 timestamp;
|
__le64 timestamp;
|
||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.2 */
|
/* 802.11, Section 8.3.3.2 */
|
||||||
@ -392,7 +392,7 @@ struct mmpdu_beacon {
|
|||||||
__le64 timestamp;
|
__le64 timestamp;
|
||||||
__le16 beacon_interval;
|
__le16 beacon_interval;
|
||||||
struct mmpdu_field_capability capability;
|
struct mmpdu_field_capability capability;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* 802.11, Section 8.3.3.11 */
|
/* 802.11, Section 8.3.3.11 */
|
||||||
@ -406,7 +406,7 @@ struct mmpdu_authentication {
|
|||||||
/* 802.11, Section 8.3.3.12 */
|
/* 802.11, Section 8.3.3.12 */
|
||||||
struct mmpdu_deauthentication {
|
struct mmpdu_deauthentication {
|
||||||
__le16 reason_code;
|
__le16 reason_code;
|
||||||
uint8_t ies[0];
|
uint8_t ies[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
const struct mmpdu_header *mpdu_validate(const uint8_t *frame, int len);
|
const struct mmpdu_header *mpdu_validate(const uint8_t *frame, int len);
|
||||||
|
@ -99,7 +99,7 @@ struct netdev_handshake_state {
|
|||||||
struct netdev_ext_key_info {
|
struct netdev_ext_key_info {
|
||||||
uint16_t proto;
|
uint16_t proto;
|
||||||
bool noencrypt;
|
bool noencrypt;
|
||||||
struct eapol_frame frame[0];
|
struct eapol_frame frame[];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct netdev {
|
struct netdev {
|
||||||
|
@ -138,7 +138,7 @@ struct rrm_beacon_report {
|
|||||||
uint8_t bssid[6];
|
uint8_t bssid[6];
|
||||||
uint8_t antenna_id;
|
uint8_t antenna_id;
|
||||||
__le32 parent_tsf;
|
__le32 parent_tsf;
|
||||||
uint8_t subelements[0];
|
uint8_t subelements[];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
static struct l_queue *states;
|
static struct l_queue *states;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user