History

netfilter: ebtables: replace zero-length array members

As suggested by Kees[1], replace the old-style 0-element array members of multiple structs in ebtables.h with modern C99 flexible array. [1]: https://lore.kernel.org/all/5E8E0F9C-EE3F-4B0D-B827-DC47397E2A4A@kernel.org/ [ fw@strlen.de: keep struct ebt_entry_target as-is, causes compiler warning: "variable sized type 'struct ebt_entry_target' not at the end of a struct or class is a GNU extension" ]

GONG, Ruiqi committed 3 years ago

Commit a2f02c91 parent a7ed3461 file · +4 −4Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/netfilter_bridge/ebtables.h+4−4
@@ -87,7 +87,7 @@ struct ebt_entries { · 86 unmodified lines
87 /* nr. of entries */87 /* nr. of entries */
88 unsigned int nentries;88 unsigned int nentries;
89 /* entry list */89 /* entry list */
90 char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));90 char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
91};91};
92 92
93/* used for the bitmask of struct ebt_entry */93/* used for the bitmask of struct ebt_entry */
@@ -129,7 +129,7 @@ struct ebt_entry_match { · 35 unmodified lines
129 } u;129 } u;
130 /* size of data */130 /* size of data */
131 unsigned int match_size;131 unsigned int match_size;
132 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));132 unsigned char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
133};133};
134 134
135struct ebt_entry_watcher {135struct ebt_entry_watcher {
@@ -142,7 +142,7 @@ struct ebt_entry_watcher { · 6 unmodified lines
142 } u;142 } u;
143 /* size of data */143 /* size of data */
144 unsigned int watcher_size;144 unsigned int watcher_size;
145 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));145 unsigned char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
146};146};
147 147
148struct ebt_entry_target {148struct ebt_entry_target {
@@ -190,7 +190,7 @@ struct ebt_entry { · 41 unmodified lines
190 /* sizeof ebt_entry + matches + watchers + target */190 /* sizeof ebt_entry + matches + watchers + target */
191 unsigned int next_offset;191 unsigned int next_offset;
192 );192 );
193 unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));193 unsigned char elems[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
194};194};
195 195
196static __inline__ struct ebt_entry_target *196static __inline__ struct ebt_entry_target *

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t