Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a37d755 authored by Patrick McHardy's avatar Patrick McHardy Committed by Pablo Neira Ayuso
Browse files

netfilter: nf_tables: constify chain type definitions and pointers

parent 93b0806f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ struct nft_stats {
 */
struct nft_base_chain {
	struct nf_hook_ops		ops[NFT_HOOK_OPS_MAX];
	struct nf_chain_type		*type;
	const struct nf_chain_type	*type;
	u8				policy;
	struct nft_stats __percpu	*stats;
	struct nft_chain		chain;
@@ -507,8 +507,8 @@ struct nf_chain_type {
	int			family;
};

int nft_register_chain_type(struct nf_chain_type *);
void nft_unregister_chain_type(struct nf_chain_type *);
int nft_register_chain_type(const struct nf_chain_type *);
void nft_unregister_chain_type(const struct nf_chain_type *);

int nft_register_expr(struct nft_expr_type *);
void nft_unregister_expr(struct nft_expr_type *);
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static struct pernet_operations nf_tables_bridge_net_ops = {
	.exit	= nf_tables_bridge_exit_net,
};

static struct nf_chain_type filter_bridge = {
static const struct nf_chain_type filter_bridge = {
	.family		= NFPROTO_BRIDGE,
	.name		= "filter",
	.type		= NFT_CHAIN_T_DEFAULT,
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static struct pernet_operations nf_tables_arp_net_ops = {
	.exit   = nf_tables_arp_exit_net,
};

static struct nf_chain_type filter_arp = {
static const struct nf_chain_type filter_arp = {
	.family		= NFPROTO_ARP,
	.name		= "filter",
	.type		= NFT_CHAIN_T_DEFAULT,
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static struct pernet_operations nf_tables_ipv4_net_ops = {
	.exit	= nf_tables_ipv4_exit_net,
};

static struct nf_chain_type filter_ipv4 = {
static const struct nf_chain_type filter_ipv4 = {
	.family		= NFPROTO_IPV4,
	.name		= "filter",
	.type		= NFT_CHAIN_T_DEFAULT,
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ static unsigned int nf_nat_output(const struct nf_hook_ops *ops,
	return ret;
}

static struct nf_chain_type nft_chain_nat_ipv4 = {
static const struct nf_chain_type nft_chain_nat_ipv4 = {
	.family		= NFPROTO_IPV4,
	.name		= "nat",
	.type		= NFT_CHAIN_T_NAT,
Loading