diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 13:35:20 +0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 13:35:20 +0400 |
commit | ab4f21e6fb1c09b13c4c3cb8357babe8223471bd (patch) | |
tree | c392a37d8bcf178c8f54fc0b14fb124ff6d7004c /net/netfilter/xt_mac.c | |
parent | 92f3b2b1bc968caaabee8cd78bee75ab7c4af74e (diff) | |
download | linux-ab4f21e6fb1c09b13c4c3cb8357babe8223471bd.tar.xz |
netfilter: xtables: use NFPROTO_UNSPEC in more extensions
Lots of extensions are completely family-independent, so squash some code.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/xt_mac.c')
-rw-r--r-- | net/netfilter/xt_mac.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/net/netfilter/xt_mac.c b/net/netfilter/xt_mac.c index 269f9d8aef5f..c2007116ce5b 100644 --- a/net/netfilter/xt_mac.c +++ b/net/netfilter/xt_mac.c @@ -36,37 +36,25 @@ static bool mac_mt(const struct sk_buff *skb, const struct xt_match_param *par) ^ info->invert); } -static struct xt_match mac_mt_reg[] __read_mostly = { - { - .name = "mac", - .family = NFPROTO_IPV4, - .match = mac_mt, - .matchsize = sizeof(struct xt_mac_info), - .hooks = (1 << NF_INET_PRE_ROUTING) | - (1 << NF_INET_LOCAL_IN) | - (1 << NF_INET_FORWARD), - .me = THIS_MODULE, - }, - { - .name = "mac", - .family = NFPROTO_IPV6, - .match = mac_mt, - .matchsize = sizeof(struct xt_mac_info), - .hooks = (1 << NF_INET_PRE_ROUTING) | - (1 << NF_INET_LOCAL_IN) | - (1 << NF_INET_FORWARD), - .me = THIS_MODULE, - }, +static struct xt_match mac_mt_reg __read_mostly = { + .name = "mac", + .revision = 0, + .family = NFPROTO_UNSPEC, + .match = mac_mt, + .matchsize = sizeof(struct xt_mac_info), + .hooks = (1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_IN) | + (1 << NF_INET_FORWARD), + .me = THIS_MODULE, }; static int __init mac_mt_init(void) { - return xt_register_matches(mac_mt_reg, ARRAY_SIZE(mac_mt_reg)); + return xt_register_match(&mac_mt_reg); } static void __exit mac_mt_exit(void) { - xt_unregister_matches(mac_mt_reg, ARRAY_SIZE(mac_mt_reg)); + xt_unregister_match(&mac_mt_reg); } module_init(mac_mt_init); |