netfilter: ebtables: avoid explicit XT_ALIGN() in match/targets
authorFlorian Westphal <fwestphal@astaro.com>
Mon, 15 Feb 2010 17:16:26 +0000 (18:16 +0100)
committerPatrick McHardy <kaber@trash.net>
Mon, 15 Feb 2010 17:16:26 +0000 (18:16 +0100)
This will cause trouble once CONFIG_COMPAT support is added to ebtables.
xt_compat_*_offset() calculate the kernel/userland structure size delta
using:

XT_ALIGN(size) - COMPAT_XT_ALIGN(size)

If the match/target sizes are aligned at registration time,
delta is always zero.

Should have zero effect for existing systems: xtables uses
XT_ALIGN() whenever it deals with match/target sizes.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 files changed:
net/bridge/netfilter/ebt_802_3.c
net/bridge/netfilter/ebt_arp.c
net/bridge/netfilter/ebt_arpreply.c
net/bridge/netfilter/ebt_dnat.c
net/bridge/netfilter/ebt_ip.c
net/bridge/netfilter/ebt_ip6.c
net/bridge/netfilter/ebt_limit.c
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_mark.c
net/bridge/netfilter/ebt_mark_m.c
net/bridge/netfilter/ebt_nflog.c
net/bridge/netfilter/ebt_pkttype.c
net/bridge/netfilter/ebt_redirect.c
net/bridge/netfilter/ebt_snat.c
net/bridge/netfilter/ebt_stp.c
net/bridge/netfilter/ebt_ulog.c
net/bridge/netfilter/ebt_vlan.c

index bd91dc58d49bef7c34328983138388673220b728..5d1176758ca56ab7b993d086ce92ebbe5166fc6b 100644 (file)
@@ -52,7 +52,7 @@ static struct xt_match ebt_802_3_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_802_3_mt,
        .checkentry     = ebt_802_3_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_802_3_info)),
+       .matchsize      = sizeof(struct ebt_802_3_info),
        .me             = THIS_MODULE,
 };
 
index b7ad60419f9ad3283bb05cf24fca3b27701ff31d..e727697c58476ede5ce5ce00d8d3549aa4ef2971 100644 (file)
@@ -120,7 +120,7 @@ static struct xt_match ebt_arp_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_arp_mt,
        .checkentry     = ebt_arp_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_arp_info)),
+       .matchsize      = sizeof(struct ebt_arp_info),
        .me             = THIS_MODULE,
 };
 
index 76584cd72e57295ce2bbae860d78c80f9d1bd2a0..f392e9d93f53404d50628494fdec57d573e17fba 100644 (file)
@@ -78,7 +78,7 @@ static struct xt_target ebt_arpreply_tg_reg __read_mostly = {
        .hooks          = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_PRE_ROUTING),
        .target         = ebt_arpreply_tg,
        .checkentry     = ebt_arpreply_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_arpreply_info)),
+       .targetsize     = sizeof(struct ebt_arpreply_info),
        .me             = THIS_MODULE,
 };
 
index 6b49ea9e31fb04f5852499f575a14f10750bf876..2bb40d728a35ae37b0ab875b33c9dfd3f490c14b 100644 (file)
@@ -54,7 +54,7 @@ static struct xt_target ebt_dnat_tg_reg __read_mostly = {
                          (1 << NF_BR_LOCAL_OUT) | (1 << NF_BR_BROUTING),
        .target         = ebt_dnat_tg,
        .checkentry     = ebt_dnat_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_nat_info)),
+       .targetsize     = sizeof(struct ebt_nat_info),
        .me             = THIS_MODULE,
 };
 
index d771bbfbcbe603a5d40844cc947c016abd266152..5de6df6f86b8acbdb385b56f2bd62a5f16cf92e8 100644 (file)
@@ -110,7 +110,7 @@ static struct xt_match ebt_ip_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_ip_mt,
        .checkentry     = ebt_ip_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_ip_info)),
+       .matchsize      = sizeof(struct ebt_ip_info),
        .me             = THIS_MODULE,
 };
 
index 784a6573876c122561ce0d2d094df7ac02919c09..bbf2534ef026e37cb604394dd9af48f7b7e82cd9 100644 (file)
@@ -122,7 +122,7 @@ static struct xt_match ebt_ip6_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_ip6_mt,
        .checkentry     = ebt_ip6_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_ip6_info)),
+       .matchsize      = sizeof(struct ebt_ip6_info),
        .me             = THIS_MODULE,
 };
 
index f7bd9192ff0c8698a1e4b9681e413c16d2d5e9cb..9dd16e6b10e724cd360055cdeb06950c6ed41815 100644 (file)
@@ -90,7 +90,7 @@ static struct xt_match ebt_limit_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_limit_mt,
        .checkentry     = ebt_limit_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_limit_info)),
+       .matchsize      = sizeof(struct ebt_limit_info),
        .me             = THIS_MODULE,
 };
 
index e4ea3fdd1d41c1969194a3565ad1c6dde33a569d..e873924ddb5db959efdc791eedd0c41fcbef6338 100644 (file)
@@ -195,7 +195,7 @@ static struct xt_target ebt_log_tg_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .target         = ebt_log_tg,
        .checkentry     = ebt_log_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_log_info)),
+       .targetsize     = sizeof(struct ebt_log_info),
        .me             = THIS_MODULE,
 };
 
index 2fee7e8e2e93ec1e89b952d747f4c4385b3333f3..153e167374a21fd2fef1e41b82a5a7d45534e204 100644 (file)
@@ -59,7 +59,7 @@ static struct xt_target ebt_mark_tg_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .target         = ebt_mark_tg,
        .checkentry     = ebt_mark_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_mark_t_info)),
+       .targetsize     = sizeof(struct ebt_mark_t_info),
        .me             = THIS_MODULE,
 };
 
index ea570f214b1df3d8942cd6a37600aec3615c444e..89abf40303991c0efac2cb91666c9dbc3275ed00 100644 (file)
@@ -41,7 +41,7 @@ static struct xt_match ebt_mark_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_mark_mt,
        .checkentry     = ebt_mark_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_mark_m_info)),
+       .matchsize      = sizeof(struct ebt_mark_m_info),
        .me             = THIS_MODULE,
 };
 
index 2a63d996dd4e149f169324483e1fd7753fec3d34..40dbd248b9ae284fb3b13e6b36455c6b8aa6fef9 100644 (file)
@@ -51,7 +51,7 @@ static struct xt_target ebt_nflog_tg_reg __read_mostly = {
        .family     = NFPROTO_BRIDGE,
        .target     = ebt_nflog_tg,
        .checkentry = ebt_nflog_tg_check,
-       .targetsize = XT_ALIGN(sizeof(struct ebt_nflog_info)),
+       .targetsize = sizeof(struct ebt_nflog_info),
        .me         = THIS_MODULE,
 };
 
index 883e96e2a5420e133336930e88d678fd486ed972..e2a07e6cbef381fdc86891debbc960ca8ff8a226 100644 (file)
@@ -36,7 +36,7 @@ static struct xt_match ebt_pkttype_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_pkttype_mt,
        .checkentry     = ebt_pkttype_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_pkttype_info)),
+       .matchsize      = sizeof(struct ebt_pkttype_info),
        .me             = THIS_MODULE,
 };
 
index c8a49f7a57ba90391b1d0707bd680e1a01f15883..9be8fbcd370b93eb33137c8e4e2c2f08b432f919 100644 (file)
@@ -59,7 +59,7 @@ static struct xt_target ebt_redirect_tg_reg __read_mostly = {
                          (1 << NF_BR_BROUTING),
        .target         = ebt_redirect_tg,
        .checkentry     = ebt_redirect_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_redirect_info)),
+       .targetsize     = sizeof(struct ebt_redirect_info),
        .me             = THIS_MODULE,
 };
 
index 8d04d4c302bdc9303958553fb831732d05f24abb..9c7b520765a2de7c629ee7abe2f9c78fe8f1c69f 100644 (file)
@@ -67,7 +67,7 @@ static struct xt_target ebt_snat_tg_reg __read_mostly = {
        .hooks          = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_POST_ROUTING),
        .target         = ebt_snat_tg,
        .checkentry     = ebt_snat_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_nat_info)),
+       .targetsize     = sizeof(struct ebt_nat_info),
        .me             = THIS_MODULE,
 };
 
index 75e29a9cebdaf8dc80c0c6b3eedbeb5f80b4ef3e..92a93d363765ecca1368326f39cd5a0872ff453b 100644 (file)
@@ -177,7 +177,7 @@ static struct xt_match ebt_stp_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_stp_mt,
        .checkentry     = ebt_stp_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_stp_info)),
+       .matchsize      = sizeof(struct ebt_stp_info),
        .me             = THIS_MODULE,
 };
 
index ce50688a6431681f55f979a1f674fc11fab31ba8..c6ac657074a6b6471a1bb554fe7bb123ed676944 100644 (file)
@@ -275,7 +275,7 @@ static struct xt_target ebt_ulog_tg_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .target         = ebt_ulog_tg,
        .checkentry     = ebt_ulog_tg_check,
-       .targetsize     = XT_ALIGN(sizeof(struct ebt_ulog_info)),
+       .targetsize     = sizeof(struct ebt_ulog_info),
        .me             = THIS_MODULE,
 };
 
index 3dddd489328e19bedb8c0876cfc0884947100811..be1dd2e1f61517fca4e77fb8cebe521ea7c468bf 100644 (file)
@@ -163,7 +163,7 @@ static struct xt_match ebt_vlan_mt_reg __read_mostly = {
        .family         = NFPROTO_BRIDGE,
        .match          = ebt_vlan_mt,
        .checkentry     = ebt_vlan_mt_check,
-       .matchsize      = XT_ALIGN(sizeof(struct ebt_vlan_info)),
+       .matchsize      = sizeof(struct ebt_vlan_info),
        .me             = THIS_MODULE,
 };