]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: nfnetlink: add and use nfnetlink_broadcast
authorFlorian Westphal <fw@strlen.de>
Thu, 1 Apr 2021 14:11:04 +0000 (16:11 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 5 Apr 2021 22:34:51 +0000 (00:34 +0200)
This removes the only reference of net->nfnl outside of the nfnetlink
module.  This allows to move net->nfnl to net_generic infra.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/nfnetlink.h
net/netfilter/nfnetlink.c
net/netfilter/nfnetlink_acct.c

index 791d516e1e880e62a009684888f9fd7dcf9e4ad3..d4c14257db5da311fa41b2e4a7baf6f0d67371c9 100644 (file)
@@ -51,6 +51,8 @@ int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
                   unsigned int group, int echo, gfp_t flags);
 int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
 int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid);
+void nfnetlink_broadcast(struct net *net, struct sk_buff *skb, __u32 portid,
+                        __u32 group, gfp_t allocation);
 
 static inline u16 nfnl_msg_type(u8 subsys, u8 msg_type)
 {
index d3df66a39b5e004b4e583d56ee4c0c40bbb2cdd9..06e106b3ed8587e895b839e7991eeb68c12fb379 100644 (file)
@@ -178,6 +178,13 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid)
 }
 EXPORT_SYMBOL_GPL(nfnetlink_unicast);
 
+void nfnetlink_broadcast(struct net *net, struct sk_buff *skb, __u32 portid,
+                        __u32 group, gfp_t allocation)
+{
+       netlink_broadcast(net->nfnl, skb, portid, group, allocation);
+}
+EXPORT_SYMBOL_GPL(nfnetlink_broadcast);
+
 /* Process one complete nfnetlink message. */
 static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
                             struct netlink_ext_ack *extack)
index bb930f3b06c70bc39356224b0ea0292475ddb4c9..6895f31c5fbbcab2b4ea3ee5a2a73557355032ae 100644 (file)
@@ -469,8 +469,7 @@ static void nfnl_overquota_report(struct net *net, struct nf_acct *nfacct)
                kfree_skb(skb);
                return;
        }
-       netlink_broadcast(net->nfnl, skb, 0, NFNLGRP_ACCT_QUOTA,
-                         GFP_ATOMIC);
+       nfnetlink_broadcast(net, skb, 0, NFNLGRP_ACCT_QUOTA, GFP_ATOMIC);
 }
 
 int nfnl_acct_overquota(struct net *net, struct nf_acct *nfacct)