Skip to content

Commit

Permalink
net: Convert log pernet_operations
Browse files Browse the repository at this point in the history
These pernet_operations use nf_log_set() and nf_log_unset()
in their methods:

	nf_log_bridge_net_ops
	nf_log_arp_net_ops
	nf_log_ipv4_net_ops
	nf_log_ipv6_net_ops
	nf_log_netdev_net_ops

Nobody can send such a packet to a net before it's became
registered, nobody can send a packet after all netdevices
are unregistered. So, these pernet_operations are able
to be marked as async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kirill Tkhai authored and David S. Miller committed Mar 5, 2018
1 parent ec012f3 commit 3822034
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/bridge/netfilter/nf_log_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static void __net_exit nf_log_bridge_net_exit(struct net *net)
static struct pernet_operations nf_log_bridge_net_ops = {
.init = nf_log_bridge_net_init,
.exit = nf_log_bridge_net_exit,
.async = true,
};

static int __init nf_log_bridge_init(void)
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/netfilter/nf_log_arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ static void __net_exit nf_log_arp_net_exit(struct net *net)
static struct pernet_operations nf_log_arp_net_ops = {
.init = nf_log_arp_net_init,
.exit = nf_log_arp_net_exit,
.async = true,
};

static int __init nf_log_arp_init(void)
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/netfilter/nf_log_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ static void __net_exit nf_log_ipv4_net_exit(struct net *net)
static struct pernet_operations nf_log_ipv4_net_ops = {
.init = nf_log_ipv4_net_init,
.exit = nf_log_ipv4_net_exit,
.async = true,
};

static int __init nf_log_ipv4_init(void)
Expand Down
1 change: 1 addition & 0 deletions net/ipv6/netfilter/nf_log_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ static void __net_exit nf_log_ipv6_net_exit(struct net *net)
static struct pernet_operations nf_log_ipv6_net_ops = {
.init = nf_log_ipv6_net_init,
.exit = nf_log_ipv6_net_exit,
.async = true,
};

static int __init nf_log_ipv6_init(void)
Expand Down
1 change: 1 addition & 0 deletions net/netfilter/nf_log_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static void __net_exit nf_log_netdev_net_exit(struct net *net)
static struct pernet_operations nf_log_netdev_net_ops = {
.init = nf_log_netdev_net_init,
.exit = nf_log_netdev_net_exit,
.async = true,
};

static int __init nf_log_netdev_init(void)
Expand Down

0 comments on commit 3822034

Please sign in to comment.