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

Commit cc07eeb0 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso
Browse files

netfilter: nf_tables: nft_register_chain_type() returns void



Use WARN_ON() instead since it should not happen that neither family
goes over NFPROTO_NUMPROTO nor there is already a chain of this type
already registered.

Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 32537e91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -970,7 +970,7 @@ struct nft_table {
	char				*name;
};

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

int nft_register_expr(struct nft_expr_type *);
+3 −1
Original line number Diff line number Diff line
@@ -63,7 +63,9 @@ static const struct nft_chain_type filter_bridge = {

static int __init nf_tables_bridge_init(void)
{
	return nft_register_chain_type(&filter_bridge);
	nft_register_chain_type(&filter_bridge);

	return 0;
}

static void __exit nf_tables_bridge_exit(void)
+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@ static const struct nft_chain_type filter_arp = {

static int __init nf_tables_arp_init(void)
{
	return nft_register_chain_type(&filter_arp);
	nft_register_chain_type(&filter_arp);

	return 0;
}

static void __exit nf_tables_arp_exit(void)
+3 −1
Original line number Diff line number Diff line
@@ -51,7 +51,9 @@ static const struct nft_chain_type filter_ipv4 = {

static int __init nf_tables_ipv4_init(void)
{
	return nft_register_chain_type(&filter_ipv4);
	nft_register_chain_type(&filter_ipv4);

	return 0;
}

static void __exit nf_tables_ipv4_exit(void)
+1 −5
Original line number Diff line number Diff line
@@ -86,11 +86,7 @@ static const struct nft_chain_type nft_chain_nat_ipv4 = {

static int __init nft_chain_nat_init(void)
{
	int err;

	err = nft_register_chain_type(&nft_chain_nat_ipv4);
	if (err < 0)
		return err;
	nft_register_chain_type(&nft_chain_nat_ipv4);

	return 0;
}
Loading