Received: by 10.192.165.148 with SMTP id m20csp2802302imm; Mon, 7 May 2018 01:09:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoAo4mX3V/j7lJalrpRAQ5APp1Uur2LHR48cmpNt8qQbVxcjdXwDjNfM7Z3LLNwopg1kt6M X-Received: by 2002:a65:6027:: with SMTP id p7-v6mr16031673pgu.210.1525680543679; Mon, 07 May 2018 01:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525680543; cv=none; d=google.com; s=arc-20160816; b=LcTHEnGPoAxL0sD9Vb8W/mklZYiyK1bkAZD27OdvsMXTFHuwF8DDno6fbdrzyxV2v9 TdtGVll6AxuXkRyU3JL161SiVUtUAzLkEkwi1RFpfCnCMY5ccM+IT7k36B3ht61tQkE4 OjyIeJ912xqXpqKZciWaSdzt2uRQVnuMcz/2tR17rNxEEbvy6GwNy5VvVDfOJ42nHXSm OmsTeHWu2veUfSsgdGuBzj52mKCTBeYnJgiVrI41Xk+gc3UV8BRubGcZ746tEdI5UPvn l+VIvxYxWHK7W8uVKyMXt0Z8zexg082xNFZBY0Btlpr2g1rRH/vZDvWKGuNqcR1bCfI5 fpRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=uDIn2Pq/x/zsfQvAvTUc7cqAcnEwJ9gzi0dtkb7fKWs=; b=s3nJHFCJk/Yr4K3sWJsJVegDk3eoJ12rD/GZ6/mqPgDcHmv3j4F1lk2bvFTJujlPRo 8mzvKXjx297wZERKx67WU9hMk97w2J3iTxprjnBFdOFhszWjLLEE+6gDkXmXmdL+4/c6 V09wBit3N5f+l3wRm1/CqVJ3yaq6WF46pTte7xmkWqK7MrppM/fzPZiH2/68LzeGTYQP snQa3V5vQ94a/k3O0/+AoJUsBf6oklZcQEmF3hPBHNtdDSzN6JJS6dRcGc/O+KbGzw69 +oXLwPkZeRwmqkq7ZJF9ILPwyO1rqysGmiaelpcezC74bt3IfS5nIu0ieFN/I0FO+aYW II2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=WZi3zsnY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si2270698pfh.346.2018.05.07.01.08.49; Mon, 07 May 2018 01:09:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=WZi3zsnY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbeEGIIZ (ORCPT + 99 others); Mon, 7 May 2018 04:08:25 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44558 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbeEGIIX (ORCPT ); Mon, 7 May 2018 04:08:23 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4781RV3024112; Mon, 7 May 2018 08:07:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=uDIn2Pq/x/zsfQvAvTUc7cqAcnEwJ9gzi0dtkb7fKWs=; b=WZi3zsnYu1kcSptJ1fmJyn+K1aB8Vq3oe4a0zfozDNlucu6xwL/HPkuhsQFmnDZAANYq 1MnQu70EUiAzJtH82drekskmqq9k9RWMP4isT7QnoigkJ5JZ/fhqoGjt883nehsg6eRE pN+SaxKtLJnRqtQNahXxy7S5ozrC55bosR+bC91srmUeq7nJUz6Kaqyb9/H57Gm8zcG3 9gSvVLkDujHZF2QoecFda6eoULFJZt7BU1J/ptMWjIVALJ5T6Cp9IhJvJYuisYPLskD1 3ROcBpGcwEseBRVMvTBEEdEPEwMC04JH8j6Uv1ZMIy8XnKiDP52pfjUrAD4xtHtWpVJo Og== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2hs426b5k0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 May 2018 08:07:59 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4787vu5000478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 May 2018 08:07:57 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4787sBo024093; Mon, 7 May 2018 08:07:54 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 May 2018 01:07:53 -0700 Date: Mon, 7 May 2018 11:07:44 +0300 From: Dan Carpenter To: kbuild@01.org, Kristian Evensen Cc: kbuild-all@01.org, netfilter-devel@vger.kernel.org, Kristian Evensen , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: nf_queue: Replace conntrack entry Message-ID: <20180507080744.pbdilayv6udlb6ru@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180503140745.26588-1-kristian.evensen@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8885 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805070084 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kristian, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on nf-next/master] [also build test WARNING on v4.17-rc3 next-20180504] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Kristian-Evensen/netfilter-nf_queue-Replace-conntrack-entry/20180504-051218 base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master smatch warnings: net/netfilter/nfnetlink_queue.c:1141 nfqnl_recv_verdict_batch() warn: curly braces intended? # https://github.com/0day-ci/linux/commit/8776e32a6c6e2ba0c6c8ce85e227672b81a1649d git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout 8776e32a6c6e2ba0c6c8ce85e227672b81a1649d vim +1141 net/netfilter/nfnetlink_queue.c 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1093 7b8002a1 net/netfilter/nfnetlink_queue.c Pablo Neira Ayuso 2015-12-15 1094 static int nfqnl_recv_verdict_batch(struct net *net, struct sock *ctnl, 7b8002a1 net/netfilter/nfnetlink_queue.c Pablo Neira Ayuso 2015-12-15 1095 struct sk_buff *skb, 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1096 const struct nlmsghdr *nlh, 04ba724b net/netfilter/nfnetlink_queue.c Pablo Neira Ayuso 2017-06-19 1097 const struct nlattr * const nfqa[], 04ba724b net/netfilter/nfnetlink_queue.c Pablo Neira Ayuso 2017-06-19 1098 struct netlink_ext_ack *extack) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1099 { 3da07c0c net/netfilter/nfnetlink_queue_core.c David S. Miller 2012-06-26 1100 struct nfgenmsg *nfmsg = nlmsg_data(nlh); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1101 struct nf_queue_entry *entry, *tmp; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1102 unsigned int verdict, maxid; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1103 struct nfqnl_msg_verdict_hdr *vhdr; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1104 struct nfqnl_instance *queue; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1105 LIST_HEAD(batch_list); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1106 u16 queue_num = ntohs(nfmsg->res_id); e8179610 net/netfilter/nfnetlink_queue_core.c Gao feng 2013-03-24 1107 struct nfnl_queue_net *q = nfnl_queue_pernet(net); 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1108 enum ip_conntrack_info ctinfo; e8179610 net/netfilter/nfnetlink_queue_core.c Gao feng 2013-03-24 1109 e8179610 net/netfilter/nfnetlink_queue_core.c Gao feng 2013-03-24 1110 queue = verdict_instance_lookup(q, queue_num, e8179610 net/netfilter/nfnetlink_queue_core.c Gao feng 2013-03-24 1111 NETLINK_CB(skb).portid); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1112 if (IS_ERR(queue)) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1113 return PTR_ERR(queue); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1114 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1115 vhdr = verdicthdr_get(nfqa); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1116 if (!vhdr) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1117 return -EINVAL; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1118 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1119 verdict = ntohl(vhdr->verdict); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1120 maxid = ntohl(vhdr->id); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1121 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1122 spin_lock_bh(&queue->lock); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1123 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1124 list_for_each_entry_safe(entry, tmp, &queue->queue_list, list) { 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1125 if (nfq_id_after(entry->id, maxid)) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1126 break; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1127 __dequeue_entry(queue, entry); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1128 list_add_tail(&entry->list, &batch_list); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1129 } 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1130 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1131 spin_unlock_bh(&queue->lock); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1132 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1133 if (list_empty(&batch_list)) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1134 return -ENOENT; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1135 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1136 list_for_each_entry_safe(entry, tmp, &batch_list, list) { 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1137 if (nfqa[NFQA_MARK]) 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1138 entry->skb->mark = ntohl(nla_get_be32(nfqa[NFQA_MARK])); 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1139 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1140 #if IS_ENABLED(CONFIG_NF_CONNTRACK) 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 @1141 nf_ct_get(entry->skb, &ctinfo); 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1142 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1143 if (ctinfo == IP_CT_NEW && verdict != NF_STOLEN && 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1144 verdict != NF_DROP) { 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1145 nfqnl_update_ct(net, entry->skb); 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1146 } 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1147 #endif 8776e32a net/netfilter/nfnetlink_queue.c Kristian Evensen 2018-05-03 1148 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1149 nf_reinject(entry, verdict); 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1150 } 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1151 return 0; 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1152 } 97d32cf9 net/netfilter/nfnetlink_queue.c Florian Westphal 2011-07-19 1153 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation