From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B16D4168 for ; Mon, 12 Jul 2021 16:55:55 +0000 (UTC) Received: from netfilter.org (unknown [90.77.255.23]) by mail.netfilter.org (Postfix) with ESMTPSA id C052A61657; Mon, 12 Jul 2021 18:48:51 +0200 (CEST) Date: Mon, 12 Jul 2021 18:49:04 +0200 From: Pablo Neira Ayuso To: Yajun Deng Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, mathew.j.martineau@linux.intel.com, matthieu.baerts@tessares.net, kadlec@netfilter.org, fw@strlen.de, vyasevich@gmail.com, nhorman@tuxdriver.com, marcelo.leitner@gmail.com, johannes.berg@intel.com, ast@kernel.org, yhs@fb.com, 0x7f454c46@gmail.com, aahringo@redhat.com, rdunlap@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mptcp@lists.linux.dev, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-sctp@vger.kernel.org Subject: Re: [PATCH] net: Use nlmsg_unicast() instead of netlink_unicast() Message-ID: <20210712164904.GA16733@salvia> References: <20210712125301.14248-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210712125301.14248-1-yajun.deng@linux.dev> User-Agent: Mutt/1.10.1 (2018-07-13) On Mon, Jul 12, 2021 at 08:53:01PM +0800, Yajun Deng wrote: > diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c > index 639c337c885b..aa3397eec330 100644 > --- a/net/netfilter/nft_compat.c > +++ b/net/netfilter/nft_compat.c > @@ -683,10 +683,8 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb, > goto out_put; > } > > - ret = netlink_unicast(info->sk, skb2, NETLINK_CB(skb).portid, > - MSG_DONTWAIT); > - if (ret > 0) > - ret = 0; > + ret = nlmsg_unicast(info->sk, skb2, NETLINK_CB(skb).portid); netfilter needs nfnetlink_unicast to deal with EAGAIN, see e0241ae6ac59 So either: a) use nfnetlink_unicast. b) remove this chunk and I'll route a patch to fix this in the netfilter tree. Pick one at your choice. Thanks. > out_put: > rcu_read_lock(); > module_put(THIS_MODULE);