From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: [PATCH nf-next 1/4] netfilter: nf_log: handle NFPROTO_INET properly in nf_logger_[find_get|put] Date: Thu, 23 Jun 2016 13:22:05 +0200 Message-ID: <20160623112205.GA2873@salvia> References: <1465389800-27842-1-git-send-email-zlpnobody@163.com> <1465389800-27842-2-git-send-email-zlpnobody@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netfilter-devel@vger.kernel.org, Liping Zhang To: Liping Zhang Return-path: Received: from mail.us.es ([193.147.175.20]:59783 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbcFWLWL (ORCPT ); Thu, 23 Jun 2016 07:22:11 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 11CF216B287 for ; Thu, 23 Jun 2016 13:22:10 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 032E0266759 for ; Thu, 23 Jun 2016 13:22:10 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 36211266759 for ; Thu, 23 Jun 2016 13:22:07 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1465389800-27842-2-git-send-email-zlpnobody@163.com> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Wed, Jun 08, 2016 at 08:43:17PM +0800, Liping Zhang wrote: > From: Liping Zhang > > When we request NFPROTO_INET, it means both NFPROTO_IPV4 and NFPROTO_IPV6. > > Signed-off-by: Liping Zhang > --- > net/netfilter/nf_log.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c > index a5d41df..73b845d 100644 > --- a/net/netfilter/nf_log.c > +++ b/net/netfilter/nf_log.c > @@ -159,6 +159,20 @@ int nf_logger_find_get(int pf, enum nf_log_type type) > struct nf_logger *logger; > int ret = -ENOENT; > > + if (pf == NFPROTO_INET) { > + ret = nf_logger_find_get(NFPROTO_IPV4, type); > + if (ret < 0) > + return ret; > + > + ret = nf_logger_find_get(NFPROTO_IPV6, type); > + if (ret < 0) { > + nf_logger_put(NFPROTO_IPV4, type); > + return ret; > + } > + > + return 0; This is already done from nft_log_init(). Are you observing any problem there?