提交 fc0e3df4 编写于 作者: F Florian Westphal 提交者: Patrick McHardy

netfilter: ebtables: avoid explicit XT_ALIGN() in match/targets

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: NFlorian Westphal <fwestphal@astaro.com>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
上级 1756de26
...@@ -52,7 +52,7 @@ static struct xt_match ebt_802_3_mt_reg __read_mostly = { ...@@ -52,7 +52,7 @@ static struct xt_match ebt_802_3_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_802_3_mt, .match = ebt_802_3_mt,
.checkentry = ebt_802_3_mt_check, .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, .me = THIS_MODULE,
}; };
......
...@@ -120,7 +120,7 @@ static struct xt_match ebt_arp_mt_reg __read_mostly = { ...@@ -120,7 +120,7 @@ static struct xt_match ebt_arp_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_arp_mt, .match = ebt_arp_mt,
.checkentry = ebt_arp_mt_check, .checkentry = ebt_arp_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_arp_info)), .matchsize = sizeof(struct ebt_arp_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -78,7 +78,7 @@ static struct xt_target ebt_arpreply_tg_reg __read_mostly = { ...@@ -78,7 +78,7 @@ static struct xt_target ebt_arpreply_tg_reg __read_mostly = {
.hooks = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_PRE_ROUTING), .hooks = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_PRE_ROUTING),
.target = ebt_arpreply_tg, .target = ebt_arpreply_tg,
.checkentry = ebt_arpreply_tg_check, .checkentry = ebt_arpreply_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_arpreply_info)), .targetsize = sizeof(struct ebt_arpreply_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -54,7 +54,7 @@ static struct xt_target ebt_dnat_tg_reg __read_mostly = { ...@@ -54,7 +54,7 @@ static struct xt_target ebt_dnat_tg_reg __read_mostly = {
(1 << NF_BR_LOCAL_OUT) | (1 << NF_BR_BROUTING), (1 << NF_BR_LOCAL_OUT) | (1 << NF_BR_BROUTING),
.target = ebt_dnat_tg, .target = ebt_dnat_tg,
.checkentry = ebt_dnat_tg_check, .checkentry = ebt_dnat_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_nat_info)), .targetsize = sizeof(struct ebt_nat_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -110,7 +110,7 @@ static struct xt_match ebt_ip_mt_reg __read_mostly = { ...@@ -110,7 +110,7 @@ static struct xt_match ebt_ip_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_ip_mt, .match = ebt_ip_mt,
.checkentry = ebt_ip_mt_check, .checkentry = ebt_ip_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_ip_info)), .matchsize = sizeof(struct ebt_ip_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -122,7 +122,7 @@ static struct xt_match ebt_ip6_mt_reg __read_mostly = { ...@@ -122,7 +122,7 @@ static struct xt_match ebt_ip6_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_ip6_mt, .match = ebt_ip6_mt,
.checkentry = ebt_ip6_mt_check, .checkentry = ebt_ip6_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_ip6_info)), .matchsize = sizeof(struct ebt_ip6_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -90,7 +90,7 @@ static struct xt_match ebt_limit_mt_reg __read_mostly = { ...@@ -90,7 +90,7 @@ static struct xt_match ebt_limit_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_limit_mt, .match = ebt_limit_mt,
.checkentry = ebt_limit_mt_check, .checkentry = ebt_limit_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_limit_info)), .matchsize = sizeof(struct ebt_limit_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -195,7 +195,7 @@ static struct xt_target ebt_log_tg_reg __read_mostly = { ...@@ -195,7 +195,7 @@ static struct xt_target ebt_log_tg_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.target = ebt_log_tg, .target = ebt_log_tg,
.checkentry = ebt_log_tg_check, .checkentry = ebt_log_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_log_info)), .targetsize = sizeof(struct ebt_log_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -59,7 +59,7 @@ static struct xt_target ebt_mark_tg_reg __read_mostly = { ...@@ -59,7 +59,7 @@ static struct xt_target ebt_mark_tg_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.target = ebt_mark_tg, .target = ebt_mark_tg,
.checkentry = ebt_mark_tg_check, .checkentry = ebt_mark_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_mark_t_info)), .targetsize = sizeof(struct ebt_mark_t_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -41,7 +41,7 @@ static struct xt_match ebt_mark_mt_reg __read_mostly = { ...@@ -41,7 +41,7 @@ static struct xt_match ebt_mark_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_mark_mt, .match = ebt_mark_mt,
.checkentry = ebt_mark_mt_check, .checkentry = ebt_mark_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_mark_m_info)), .matchsize = sizeof(struct ebt_mark_m_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -51,7 +51,7 @@ static struct xt_target ebt_nflog_tg_reg __read_mostly = { ...@@ -51,7 +51,7 @@ static struct xt_target ebt_nflog_tg_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.target = ebt_nflog_tg, .target = ebt_nflog_tg,
.checkentry = ebt_nflog_tg_check, .checkentry = ebt_nflog_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_nflog_info)), .targetsize = sizeof(struct ebt_nflog_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -36,7 +36,7 @@ static struct xt_match ebt_pkttype_mt_reg __read_mostly = { ...@@ -36,7 +36,7 @@ static struct xt_match ebt_pkttype_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_pkttype_mt, .match = ebt_pkttype_mt,
.checkentry = ebt_pkttype_mt_check, .checkentry = ebt_pkttype_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_pkttype_info)), .matchsize = sizeof(struct ebt_pkttype_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -59,7 +59,7 @@ static struct xt_target ebt_redirect_tg_reg __read_mostly = { ...@@ -59,7 +59,7 @@ static struct xt_target ebt_redirect_tg_reg __read_mostly = {
(1 << NF_BR_BROUTING), (1 << NF_BR_BROUTING),
.target = ebt_redirect_tg, .target = ebt_redirect_tg,
.checkentry = ebt_redirect_tg_check, .checkentry = ebt_redirect_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_redirect_info)), .targetsize = sizeof(struct ebt_redirect_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -67,7 +67,7 @@ static struct xt_target ebt_snat_tg_reg __read_mostly = { ...@@ -67,7 +67,7 @@ static struct xt_target ebt_snat_tg_reg __read_mostly = {
.hooks = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_POST_ROUTING), .hooks = (1 << NF_BR_NUMHOOKS) | (1 << NF_BR_POST_ROUTING),
.target = ebt_snat_tg, .target = ebt_snat_tg,
.checkentry = ebt_snat_tg_check, .checkentry = ebt_snat_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_nat_info)), .targetsize = sizeof(struct ebt_nat_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -177,7 +177,7 @@ static struct xt_match ebt_stp_mt_reg __read_mostly = { ...@@ -177,7 +177,7 @@ static struct xt_match ebt_stp_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_stp_mt, .match = ebt_stp_mt,
.checkentry = ebt_stp_mt_check, .checkentry = ebt_stp_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_stp_info)), .matchsize = sizeof(struct ebt_stp_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -275,7 +275,7 @@ static struct xt_target ebt_ulog_tg_reg __read_mostly = { ...@@ -275,7 +275,7 @@ static struct xt_target ebt_ulog_tg_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.target = ebt_ulog_tg, .target = ebt_ulog_tg,
.checkentry = ebt_ulog_tg_check, .checkentry = ebt_ulog_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_ulog_info)), .targetsize = sizeof(struct ebt_ulog_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
...@@ -163,7 +163,7 @@ static struct xt_match ebt_vlan_mt_reg __read_mostly = { ...@@ -163,7 +163,7 @@ static struct xt_match ebt_vlan_mt_reg __read_mostly = {
.family = NFPROTO_BRIDGE, .family = NFPROTO_BRIDGE,
.match = ebt_vlan_mt, .match = ebt_vlan_mt,
.checkentry = ebt_vlan_mt_check, .checkentry = ebt_vlan_mt_check,
.matchsize = XT_ALIGN(sizeof(struct ebt_vlan_info)), .matchsize = sizeof(struct ebt_vlan_info),
.me = THIS_MODULE, .me = THIS_MODULE,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册