[RFC] ebtable_replace alignment padding
Stephen Hemminger <[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Organization | Open Source Development Lab |
| Message-ID | <20040616160221.5990e962@dell_ss3.pdx.osdl.net> |
Sparse found this problem. The data portion of ebt_entries structure is aligned to ebt_replace. But ebt_replace comes out to 62 bytes (on i386). The simple fix is to pad ebt_replace so it is 64 bytes, but not sure if breaks anything. diff -Nru a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h --- a/include/linux/netfilter_bridge/ebtables.h 2004-06-16 16:00:03 -07:00 +++ b/include/linux/netfilter_bridge/ebtables.h 2004-06-16 16:00:03 -07:00 @@ -47,6 +47,9 @@ unsigned int num_counters; /* where the kernel will put the old counters */ struct ebt_counter *counters; + /* pad to make sizeof(ebt_replace) a power of 2 */ + void *pad; + char *entries; }; ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND