From patchwork Thu May 13 18:26:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1478171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 4Fh0Vq6B6Cz9sWM for ; Fri, 14 May 2021 04:26:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 449B33C642D for ; Thu, 13 May 2021 20:26:57 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (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 BEFB43C209F for ; Thu, 13 May 2021 20:26:54 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 5F1A1201016 for ; Thu, 13 May 2021 20:26:46 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A2B67AFC2; Thu, 13 May 2021 18:26:45 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 13 May 2021 20:26:38 +0200 Message-Id: <20210513182638.5514-1-pvorel@suse.cz> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] lapi: Add missing 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" From: Petr Vorel and use them in tst_netdevice.c. This fixes on older toolchains (e.g. sourcery-arm from Buildroot): tst_netdevice.c: In function 'modify_address': tst_netdevice.c:218:44: error: 'IFA_FLAGS' undeclared (first use in this function) if (!tst_rtnl_add_attr(file, lineno, ctx, IFA_FLAGS, &addr_flags, Fixes: bc2151a65 ("lib: Add helper functions for managing network interfaces") Signed-off-by: Petr Vorel --- configure.ac | 1 + include/lapi/if_addr.h | 15 +++++++++++++++ lib/tst_netdevice.c | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 include/lapi/if_addr.h diff --git a/configure.ac b/configure.ac index 136d82d09..08a56f9ef 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ AC_CHECK_HEADERS_ONCE([ \ linux/dccp.h \ linux/fs.h \ linux/genetlink.h \ + linux/if_addr.h \ linux/if_alg.h \ linux/if_ether.h \ linux/if_packet.h \ diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h new file mode 100644 index 000000000..c1acfe4fb --- /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__ + +# ifdef HAVE_LINUX_IF_ADDR_H +# include +# endif + +#ifndef IFA_FLAGS +# define IFA_FLAGS 8 +#endif + +#endif /* LAPI_IF_ADDR_H__ */ diff --git a/lib/tst_netdevice.c b/lib/tst_netdevice.c index 5ca523759..a95f19d35 100644 --- a/lib/tst_netdevice.c +++ b/lib/tst_netdevice.c @@ -9,6 +9,8 @@ #include #include #include +#include "lapi/if_addr.h" + #define TST_NO_DEFAULT_MAIN #include "tst_test.h" #include "tst_rtnetlink.h"