From patchwork Wed Sep 29 18:17:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1534520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=jVTacbYM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKPjl75Bnz9sVw for ; Thu, 30 Sep 2021 04:17:31 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 002D63C9AD8 for ; Wed, 29 Sep 2021 20:17:29 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id BDB653C819D for ; Wed, 29 Sep 2021 20:17:18 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 650BA60221B for ; Wed, 29 Sep 2021 20:17:18 +0200 (CEST) Received: by mail-wr1-x42e.google.com with SMTP id w29so5754522wra.8 for ; Wed, 29 Sep 2021 11:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OfIyqgTtOgrWzAvzAs6VS/S4K8UqsmjZvbkktfBbY38=; b=jVTacbYMWoBfxL3BF2nSD0VmMI9M7N/BC/HGQZGZIKKXxk+ciEZbx+rzRnLmMj8+b4 bFlCyr6vTSu0yt+jCNcmSt4Ius3GCLSanxZKdOnTJIZoWBVmDrVusbMIDHy5/40zxAuT tNF2VYEeqdrg5t2g9sKDEZhLCHoYsWIcEhpFERYULfFFJ3DVojNCO7d26J+U78f2zy5G pC7s/Ug1Qsbc56iNnsb8KMIkDxpSwwfGYq578ylvXU6s8cJsBVikBgStYBZ+Djugs1YJ +MoV31h9Gcq8WXx9W27O2vP6VRlSUrDNAD3QU/tH4jmIdGEQAp0PYvvc/ur7X4qHVG7a 0w1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OfIyqgTtOgrWzAvzAs6VS/S4K8UqsmjZvbkktfBbY38=; b=aqkWuGalCT2/75KbWg7VduSMovKxrV5+FIw8Zl57f9efH1I+HFbf8DyBMm3b/ch2UT 0uGXhNjX3CAfvpkDzlNNzw4nqovMF62xPYBeRnl6zl95E97d0OYCvstYSuP1WKvXHrqb E/H+h519OU/AStoF4GkvX1KXWmM87TjjQirf55Ru5GuXYibnAszRvw4scKdsCqJ1FSr1 yWnHZM8PQei5eVSZXD6uzFPBylrYu8v+jttp0tWYCggI36LhMBzdyJ9XzbTETewBfddE ku6V18IhO/KsNLdejyDRP2V8x9Qki7jJqmB5NDf28k5I/5p+R3sRcDo/9RR2xLbeao9a U5EQ== X-Gm-Message-State: AOAM530lcu6HglXeD1DRIVXZ6A0g71IBzSSue3RVC5EeHBb9gBth1SB7 OnzhW33hT+G8KnPcUBCBf1sgroEXn/U= X-Google-Smtp-Source: ABdhPJyvwTAhDSLN+frXWwvI/yUOqhK5rrxC1mSPeEfH7If0RP7LQojiXcnG63clxmNbLI/bPtCeWQ== X-Received: by 2002:a5d:6288:: with SMTP id k8mr1621931wru.137.1632939437994; Wed, 29 Sep 2021 11:17:17 -0700 (PDT) Received: from dell5510.suse.de (gw1.ms-free.net. [185.243.124.10]) by smtp.gmail.com with ESMTPSA id f15sm449299wrd.44.2021.09.29.11.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 11:17:17 -0700 (PDT) From: Petr Vorel To: ltp@lists.linux.it Date: Wed, 29 Sep 2021 20:17:08 +0200 Message-Id: <20210929181709.31788-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210929181709.31788-1-petr.vorel@gmail.com> References: <20210929181709.31788-1-petr.vorel@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [RFC PATCH 1/2] lapi: Create if_addr.h and reuse it in rtnetlink.h X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" There will be fix in next commit for missing IFA_F_NOPREFIXROUTE which requires creating lapi/if_addr.h. Thus move IFA_FLAGS to lapi/if_addr.h, as it belongs there and reuse lapi/if_addr.h in lapi/rtnetlink.h just like includes . Signed-off-by: Petr Vorel --- include/lapi/if_addr.h | 15 +++++++++++++++ include/lapi/rtnetlink.h | 5 +---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 include/lapi/if_addr.h diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h new file mode 100644 index 000000000..07e6a7c9b --- /dev/null +++ b/include/lapi/if_addr.h @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2021 Petr Vorel + */ + +#ifndef LAPI_IF_ADDR_H__ +#define LAPI_IF_ADDR_H__ + +#include + +#ifndef IFA_F_NOPREFIXROUTE +# define IFA_F_NOPREFIXROUTE 0x200 +#endif + +#endif /* LAPI_IF_ADDR_H__ */ diff --git a/include/lapi/rtnetlink.h b/include/lapi/rtnetlink.h index 04e9ad51a..089bf1a0d 100644 --- a/include/lapi/rtnetlink.h +++ b/include/lapi/rtnetlink.h @@ -5,9 +5,6 @@ # define LAPI_RTNETLINK_H__ #include - -#ifndef IFA_FLAGS -# define IFA_FLAGS 8 -#endif +#include "lapi/if_addr.h" #endif /* LAPI_RTNETLINK_H__ */ From patchwork Wed Sep 29 18:17:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1534521 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CusOzmUf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKPjx3J1wz9sSn for ; Thu, 30 Sep 2021 04:17:41 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4C6013C8B5F for ; Wed, 29 Sep 2021 20:17:39 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 0DE2B3C8B74 for ; Wed, 29 Sep 2021 20:17:20 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id A7AAA100115D for ; Wed, 29 Sep 2021 20:17:19 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id s21so5742783wra.7 for ; Wed, 29 Sep 2021 11:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JawMFD7cvdfJ9AnmB2hfxyQjHGSsPOFFuzC2+0Rpddg=; b=CusOzmUfQTYQefeUU/bvtafi1B74I40G5kjaZIv+zLd7sryE8okLLUZySkJWR3OhHH QdMXIje9mC+BzP7K0aLKJHC5I+MBoVV9jT4cIxfRk1gyrWCBLz8hippqgcmtRoKBxDxh oZzD47tcWIG70ohrRz7wMvi2mak//J9vTMnVq860jJ6P4dL8bcORekmtWWjysro8I4JT 8OttuymfolNiH2jxBHZ6K1rW6BHg0Q3e35jmvgEHsp2mvpxKqlIwrMvUIHVfdkFJn3Qw fB1BVgm4FsjTlqFdGPNcHoiA2uqi2+v00N9kcJFQiC6/VXEc3WmSvzHgDnNBaWztZUFn Mmng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JawMFD7cvdfJ9AnmB2hfxyQjHGSsPOFFuzC2+0Rpddg=; b=Hki5A7ALs2JREmFLNMEgLEi25Y/U43zO9XDwD+6Un7hqA7yJf+bitjQBjhtIRlvjtn KDLQH3WzBkU8yt4B1IhXeLgAYzfPm97yppPMMShqefKIUQzj2SIc/oSiiHFrUpJAu43Y 8DHx1Zoq2yOlTaqC1TRVfWsEssKlsUByTwwsOeChoTH2VGwqxodfYrCivbnQvXmGl0/Z 6A9hOMCsaG2ME5vZPB4wQJOcSXAMm7Pih5kRpUzQlBdGwCO7WRKdxZv32AIS4RYticx0 Xbp9/HqgQnNoGfHYFaukLDA7EAACtf5cZhciBXOkdYId53w8wCX1xNH3p9vSsjpJVRB1 1n/g== X-Gm-Message-State: AOAM533u8qauYBhNyHxWwxAxvqmgk/d89P2Ez/xAwhqwvfoOdR1FBCcG tiBfxW+XW+kFgXTmMPdO1+Ox1XR0Ng0= X-Google-Smtp-Source: ABdhPJwxvT68IqGZV1KjNeIKQRb69PtKB/a22YPLk2zJ7PgtxR8xNx+J2oDc2tzuMJgxBu6bixIYUQ== X-Received: by 2002:adf:8b52:: with SMTP id v18mr1553255wra.1.1632939439174; Wed, 29 Sep 2021 11:17:19 -0700 (PDT) Received: from dell5510.suse.de (gw1.ms-free.net. [185.243.124.10]) by smtp.gmail.com with ESMTPSA id f15sm449299wrd.44.2021.09.29.11.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 11:17:18 -0700 (PDT) From: Petr Vorel To: ltp@lists.linux.it Date: Wed, 29 Sep 2021 20:17:09 +0200 Message-Id: <20210929181709.31788-3-petr.vorel@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210929181709.31788-1-petr.vorel@gmail.com> References: <20210929181709.31788-1-petr.vorel@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [RFC PATCH 2/2] lapi/if_addr.h: Define IFA_FLAGS X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" and use it in icmp_rate_limit01.c. This fixes error on toolchains with very old kernel headers, e.g. Buildroot sourcery-arm: icmp_rate_limit01.c:82:3: error: 'IFA_F_NOPREFIXROUTE' undeclared (first use in this function) IFA_F_NOPREFIXROUTE); Fixed because IFA_F_NOPREFIXROUTE was added in 3.14 and the oldest system we still support is Cent0S 7 with 3.10 kernel. NOTE: Cent0S 7 is obviously heavily patched thus it contains IFA_F_NOPREFIXROUTE and therefore CI build didn't catch this error. Signed-off-by: Petr Vorel --- include/lapi/if_addr.h | 4 ++++ testcases/cve/icmp_rate_limit01.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h index 07e6a7c9b..0f7e44784 100644 --- a/include/lapi/if_addr.h +++ b/include/lapi/if_addr.h @@ -8,6 +8,10 @@ #include +#ifndef IFA_FLAGS +# define IFA_FLAGS 8 +#endif + #ifndef IFA_F_NOPREFIXROUTE # define IFA_F_NOPREFIXROUTE 0x200 #endif diff --git a/testcases/cve/icmp_rate_limit01.c b/testcases/cve/icmp_rate_limit01.c index b3a237b30..3ada32675 100644 --- a/testcases/cve/icmp_rate_limit01.c +++ b/testcases/cve/icmp_rate_limit01.c @@ -27,11 +27,12 @@ #include #include #include -#include #include #include #include + +#include "lapi/if_addr.h" #include "tst_test.h" #include "tst_netdevice.h"