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
8787 /* nr. of entries */
8888 unsigned int nentries;
8989 /* entry list */
90− char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
90+ char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
9191 };
9292
9393 /* used for the bitmask of struct ebt_entry */
@@ -129,7 +129,7 @@ struct ebt_entry_match { · 35 unmodified lines
129129 } u;
130130 /* size of data */
131131 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))));
133133 };
134134
135135 struct ebt_entry_watcher {
@@ -142,7 +142,7 @@ struct ebt_entry_watcher { · 6 unmodified lines
142142 } u;
143143 /* size of data */
144144 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))));
146146 };
147147
148148 struct ebt_entry_target {
@@ -190,7 +190,7 @@ struct ebt_entry { · 41 unmodified lines
190190 /* sizeof ebt_entry + matches + watchers + target */
191191 unsigned int next_offset;
192192 );
193− unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
193+ unsigned char elems[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
194194 };
195195
196196 static __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