From patchwork Fri Nov 11 03:26:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Tao X-Patchwork-Id: 18414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp516333wru; Thu, 10 Nov 2022 19:29:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4iNhNyrV++c7ok3BiGY1Dx8Ma15nwVBU/8Acrtvgd7HUjMwk2fGiSq9QGWcdmOa5hge83r X-Received: by 2002:a17:902:e8ce:b0:188:a1eb:9a8a with SMTP id v14-20020a170902e8ce00b00188a1eb9a8amr527316plg.153.1668137357832; Thu, 10 Nov 2022 19:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668137357; cv=none; d=google.com; s=arc-20160816; b=P4ACV0Gby7DpbZSiIvDXXUxUcbqUQPLq/Y42Cuh+U72Gs8X3C/eYS5ZU+RWetoFduD seTIHtMHakCOqPKE2IxRAD/mzP66cWAzcQr7FF4bh/FFtHgcuvwZgGQ15um7SkdQGvNL pkEsPX8QIMHWyqqu+bZ+9fdy/oXGiDreRHR3BMGBXzLbrANWbQiibnGaYlQpLUomgCxo hXYQy/uronMitQOAGlf2/+xUQwJ+x4tF6Z6x+N+EVjkP0qzS4Bk25w6MhoN8WrIxPd/t KKZDSipTUIpOmlNOZs88yKRiARqpDzrEcbXWsdyLaAAiDvq3nn8BMzVLkgEG009HoB9v iDKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:cc:to:from:message-id:dkim-signature; bh=VG03AryjN1xYa93c1hmpENqh0pc82ZJb7GUcVRfapEg=; b=C2q9jTRgoVGmmd4OSyDm88IiiD6+9vERKPanmvqPQ/1ORDtNayKHCJLrN5J0KLUolN qrSikC3b7+4boptZ76ciQQNAuYyd+7cOVpIqQQNzKTqX1BHwIVhmuc4gr2MmShRKyKMS 94gVaB57zfCOHUcFVlASjAY/OfsMsQq1YFcO/bI7HRF2rf2fiZ+ixtGYbVH/uqeyWPMv YMEYLQ5LDxD7EGHhMQKwtXbBl1u+u0FZm1OTXFnGEi2lRjLxYxmWFZSr+DBij3uAsfyK rFrKnolo9wrSY7rMgC4BaR9Pukd8SJ6Y5v9WhbflCDWXoKLp02i9k5BGt/gOaib1Raex FxEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=jxpyxrMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i129-20020a625487000000b005633c373dcbsi986768pfb.147.2022.11.10.19.29.04; Thu, 10 Nov 2022 19:29:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=jxpyxrMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbiKKD1r (ORCPT + 99 others); Thu, 10 Nov 2022 22:27:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232335AbiKKD13 (ORCPT ); Thu, 10 Nov 2022 22:27:29 -0500 Received: from out162-62-58-211.mail.qq.com (out162-62-58-211.mail.qq.com [162.62.58.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C916F68C5F for ; Thu, 10 Nov 2022 19:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1668137187; bh=VG03AryjN1xYa93c1hmpENqh0pc82ZJb7GUcVRfapEg=; h=From:To:Cc:Subject:Date; b=jxpyxrMzXu0S6nnjluXJY6+WLuU/FGUCfS4ZQWZemR8HF/hYMjCx7c7MdxBir5kFP 48pXosBCB/s22b5nLKAa40AwQ7mIhaVSnwd5Jd+FtXChZ3h2WqwTfoGBqplF7qPj9M /KYZfgMv9/h2i6jncEPn21EKkPXIcOhq0WCN6fis= Received: from localhost.localdomain ([111.199.191.46]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 695818DF; Fri, 11 Nov 2022 11:26:21 +0800 X-QQ-mid: xmsmtpt1668137181t31ricq3i Message-ID: X-QQ-XMAILINFO: NhUkPfKlCtQwXEHQjVhadMlQmPdB09PSlN9uaDXEq28soLLj8jyChox9gJTCqR REubEYCYiEeRGIsZfrpDgCR2Mkm6LMvFNCkFWnzgkRTY70pR7Fqx47jRFUEZf2U9RU9TR3ROn4WC eVH7+y0yHhajHrr6DK2C6CYOtCzXZy0Jf+UhIRGQxYCq3BoADv7UNO4eeFJM1A36OBtQROfg7UKh z/t8VQZl+IWhQIAg3dR/qF/k7yxJTPxGL/Kp7PxU/2/oMFY2pOS4wWPr3sGLWdv57/s8ovIKBAzG 2zXL6l/qCbSGaZdJ1yugAaRJnWBM0p/WJQ61XXq0V0UVmlTbr82VfGfZOHKYUv2+JXbTZXnjyH7f T72i/gaUnVPR8AmdaxnuQVPciL6r4D45K0c7o4hQu7ch1tjXLGppqO69PpN11Lwrqpw1UIvsXt1U n/Xy79DcTZcDATllKcLuwmP+mlgaRTZTMOebLj4T3VKnbfbM/I3eH4J6PNbPZfwyshk8sCcuE1hi QGI+23clUYl01WwnwOF5ghgTN8bb3XpX0ENJr4LtQXae+oYXH+PHRGPEVN8BJ2gChzSPEJFCdFPN AiPxmjT8D6vxhU2NQGl25jUfqUrGc3f3a83naZ1GQANUS19HmCAGBlQC421IoLWIV7/DRX29Z1Ew ZtxrGPv+sNy6E5g3aPp5SJVJPGVk6t6QadoWeuZC8aapdjOb4OXckbDE1MoLGvYVA/vvbmZj94xE cyxs3zXk1WsXygJ9JvVo6OMP4ACWTeyVh1XE15T95MXpJQu+R4xOpnGBHBY5sDKyZBKWUp1iJLpW xu3/q3VEBQZoGHVl+KNuACyKzeK4id4/S2Yop2kgmElAZsjhNu2Cy1XJ0drEZ3Dd6WlCEnugAWoP YP7XD8enx0UrBs8gCsuMoqWNz4eb+yDE/RVbeOLXO1r7/7H8I5MiOOv4r8zE++f1fvib229+WYX4 Cn8KXKf5Pn2iwFP5tROOBbL9jhFHI890FEjwDMQ2bgRajRuH0v5CWAD3ubDVHt From: Rong Tao To: ast@kernel.org Cc: Rong Tao , kernel test robot , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Kumar Kartikeya Dwivedi , Lorenzo Bianconi , Daniel Xu , bpf@vger.kernel.org (open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH bpf-next] selftests/bpf: Fix error undeclared identifier 'NF_NAT_MANIP_SRC' Date: Fri, 11 Nov 2022 11:26:11 +0800 X-OQ-MSGID: <20221111032613.31106-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RDNS_DYNAMIC,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749168797598519601?= X-GMAIL-MSGID: =?utf-8?q?1749168797598519601?= From: Rong Tao commit 472caa69183f("netfilter: nat: un-export nf_nat_used_tuple") introduce NF_NAT_MANIP_SRC/DST enum in include/net/netfilter/nf_nat.h, and commit b06b45e82b59("selftests/bpf: add tests for bpf_ct_set_nat_info kfunc") use NF_NAT_MANIP_SRC/DST in test_bpf_nf.c. We copy enum nf_nat_manip_type to test_bpf_nf.c fix this error. How to reproduce the error: $ make -C tools/testing/selftests/bpf/ ... CLNG-BPF [test_maps] test_bpf_nf.bpf.o error: use of undeclared identifier 'NF_NAT_MANIP_SRC' bpf_ct_set_nat_info(ct, &saddr, sport, NF_NAT_MANIP_SRC); ^ error: use of undeclared identifier 'NF_NAT_MANIP_DST' bpf_ct_set_nat_info(ct, &daddr, dport, NF_NAT_MANIP_DST); ^ 2 errors generated. Link: https://lore.kernel.org/lkml/202210280447.STsT1gvq-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Rong Tao --- tools/testing/selftests/bpf/progs/test_bpf_nf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/test_bpf_nf.c b/tools/testing/selftests/bpf/progs/test_bpf_nf.c index 227e85e85dda..307ca166ff34 100644 --- a/tools/testing/selftests/bpf/progs/test_bpf_nf.c +++ b/tools/testing/selftests/bpf/progs/test_bpf_nf.c @@ -3,6 +3,11 @@ #include #include +enum nf_nat_manip_type { + NF_NAT_MANIP_SRC, + NF_NAT_MANIP_DST +}; + #define EAFNOSUPPORT 97 #define EPROTO 71 #define ENONET 64