Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3125651pxv; Mon, 12 Jul 2021 09:52:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfgehi/c358DKjI0+eepXjitNUv+HgeGua9xczY0918sJXi5jwJUJVbz4+J2JDgT85X3Mr X-Received: by 2002:aa7:c652:: with SMTP id z18mr7999068edr.361.1626108750321; Mon, 12 Jul 2021 09:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626108750; cv=none; d=google.com; s=arc-20160816; b=NgxMnY6BMA0DAgakYnO1ocbJVEKAQNj2+Hy18ZeW2DugohfupE9yi1ly3HagcCiivY Vs4uqk2CnD0H414Ro+80gmETppAvOpFp6i4ZT1xMJM9crzDS0LrbD9GBwm8Q9ZZvFu53 Nz1rpBF7zH37g6UeEuWlCV+cNk37PDwB4vXiftCC2cbji5IWLrl0tK01J8zonRIB9Vws tb5Oo6XSfXX6vQFHheHFYRRrjY2+b1Upend15jxZTNJBu71rcfemig73PsywhiIjtFeQ Sb8wMDMYjdAsn0j0rvDM0+/N8LBHuqinB3TxQuH+4yBfmWfzbdQIZ0gy59R7+yxo1bpJ gFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=1OMOELMDoKSAyVNT3ca3uw80wjiRc6fJodWqQx8IwaY=; b=NKXF6Bm3mFa0GuTal4GsG04/WMdB6Cl5C0L/Ikb6fx0mravDM0zS2fNTK+2nTVwS69 v4Xjh5/Cpy28LmLtsRe8+R31SYp9lNzQ0WZIGjmYJ6wKShlosWS0t7dZeB/mDEQc6iJE aQ+OVSSALAfAVeG6/DFkiS9fPhM2d9Z2OhYcJWIOgMh9Og/ZkJhzVxicyWvzARcoOI+t kyjQt+ZOmRlkbODkl4bzq2UEE2gduOgnenDRF3OYtZH7N8pCekV2kjH+WSBmCsISWk/Q MEmhuSf02DBUFc5umCCXSxOiUSdA/zIbot/IABTscIbrXQi3EC1r0erIu95MHawqkkTh A/rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl18si1857318ejb.488.2021.07.12.09.52.07; Mon, 12 Jul 2021 09:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234208AbhGLQwA (ORCPT + 99 others); Mon, 12 Jul 2021 12:52:00 -0400 Received: from mail.netfilter.org ([217.70.188.207]:35796 "EHLO mail.netfilter.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbhGLQv7 (ORCPT ); Mon, 12 Jul 2021 12:51:59 -0400 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> 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);