-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains netfilter updates for net-next, they are: 1) Add the reject expression for the nf_tables bridge family, this allows us to send explicit reject (TCP RST / ICMP dest unrech) to the packets matching a rule. 2) Simplify and consolidate the nf_tables set dumping logic. This uses netlink control->data to filter out depending on the request. 3) Perform garbage collection in xt_hashlimit using a workqueue instead of a timer, which is problematic when many entries are in place in the tables, from Eric Dumazet. 4) Remove leftover code from the removed ulog target support, from Paul Bolle. 5) Dump unmodified flags in the netfilter packet accounting when resetting counters, so userspace knows that a counter was in overquota situation, from Alexey Perevalov. 6) Fix wrong usage of the bitwise functions in nfnetlink_acct, also from Alexey. 7) Fix a crash when adding new set element with an empty NFTA_SET_ELEM_LIST attribute. This patchset also includes a couple of cleanups for xt_LED from Duan Jiong and for nf_conntrack_ipv4 (using coccinelle) from Himangi Saraogi. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
10 changed files
with
133 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2014 Pablo Neira Ayuso <pablo@netfilter.org> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/module.h> | ||
#include <linux/netlink.h> | ||
#include <linux/netfilter.h> | ||
#include <linux/netfilter/nf_tables.h> | ||
#include <net/netfilter/nf_tables.h> | ||
#include <net/netfilter/nft_reject.h> | ||
|
||
static void nft_reject_bridge_eval(const struct nft_expr *expr, | ||
struct nft_data data[NFT_REG_MAX + 1], | ||
const struct nft_pktinfo *pkt) | ||
{ | ||
switch (eth_hdr(pkt->skb)->h_proto) { | ||
case htons(ETH_P_IP): | ||
return nft_reject_ipv4_eval(expr, data, pkt); | ||
case htons(ETH_P_IPV6): | ||
return nft_reject_ipv6_eval(expr, data, pkt); | ||
default: | ||
/* No explicit way to reject this protocol, drop it. */ | ||
data[NFT_REG_VERDICT].verdict = NF_DROP; | ||
break; | ||
} | ||
} | ||
|
||
static struct nft_expr_type nft_reject_bridge_type; | ||
static const struct nft_expr_ops nft_reject_bridge_ops = { | ||
.type = &nft_reject_bridge_type, | ||
.size = NFT_EXPR_SIZE(sizeof(struct nft_reject)), | ||
.eval = nft_reject_bridge_eval, | ||
.init = nft_reject_init, | ||
.dump = nft_reject_dump, | ||
}; | ||
|
||
static struct nft_expr_type nft_reject_bridge_type __read_mostly = { | ||
.family = NFPROTO_BRIDGE, | ||
.name = "reject", | ||
.ops = &nft_reject_bridge_ops, | ||
.policy = nft_reject_policy, | ||
.maxattr = NFTA_REJECT_MAX, | ||
.owner = THIS_MODULE, | ||
}; | ||
|
||
static int __init nft_reject_bridge_module_init(void) | ||
{ | ||
return nft_register_expr(&nft_reject_bridge_type); | ||
} | ||
|
||
static void __exit nft_reject_bridge_module_exit(void) | ||
{ | ||
nft_unregister_expr(&nft_reject_bridge_type); | ||
} | ||
|
||
module_init(nft_reject_bridge_module_init); | ||
module_exit(nft_reject_bridge_module_exit); | ||
|
||
MODULE_LICENSE("GPL"); | ||
MODULE_AUTHOR("Pablo Neira Ayuso <pablo@netfilter.org>"); | ||
MODULE_ALIAS_NFT_AF_EXPR(AF_BRIDGE, "reject"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.