From patchwork Thu Feb 4 15:21:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Fedorenko X-Patchwork-Id: 12067579 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BB9DC433DB for ; Thu, 4 Feb 2021 15:23:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53FA864E31 for ; Thu, 4 Feb 2021 15:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237295AbhBDPXX (ORCPT ); Thu, 4 Feb 2021 10:23:23 -0500 Received: from novek.ru ([213.148.174.62]:60962 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237067AbhBDPWF (ORCPT ); Thu, 4 Feb 2021 10:22:05 -0500 Received: from nat1.ooonet.ru (gw.zelenaya.net [91.207.137.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id 391D8503356; Thu, 4 Feb 2021 18:21:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru 391D8503356 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1612452072; bh=VK2JrCCewEy2Qv8rVYgEUmReOuUvXQaVuZqnGPrhLh8=; h=From:To:Cc:Subject:Date:From; b=eLNM5zFfVaVnE8IcdEbzTk81vXgRpTMToBHAuUVggFh+yUW2erK9G9qLAPwFNUVMw aG5rwCQZpdKCX1xjVPndMvbO5rX8aPbhV4Ux88Qr3/cDCM/n3Ti8g6N2KXhKvCqRRk hyUag31VWAEzXCKj/rezTNI7fa/9oMfSRnaoqN2Q= From: Vadim Fedorenko To: Jakub Kicinski , Jian Yang , Willem de Bruijn Cc: Vadim Fedorenko , netdev@vger.kernel.org Subject: [net v2] selftests: txtimestamp: fix compilation issue Date: Thu, 4 Feb 2021 18:21:04 +0300 Message-Id: <1612452064-20797-1-git-send-email-vfedorenko@novek.ru> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PACKET_TX_TIMESTAMP is defined in if_packet.h but it is not included in test. It could be included instead of otherwise the error of redefinition arrives. Fixes: 8fe2f761cae9 (net-timestamp: expand documentation) Suggested-by: Willem de Bruijn Signed-off-by: Vadim Fedorenko --- tools/testing/selftests/net/txtimestamp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/txtimestamp.c b/tools/testing/selftests/net/txtimestamp.c index 490a8cc..3d6bf54 100644 --- a/tools/testing/selftests/net/txtimestamp.c +++ b/tools/testing/selftests/net/txtimestamp.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -53,6 +53,7 @@ #define NSEC_PER_USEC 1000L #define USEC_PER_SEC 1000000L #define NSEC_PER_SEC 1000000000LL +#define PACKET_TX_TIMESTAMP 16 /* command line parameters */ static int cfg_proto = SOCK_STREAM; @@ -495,12 +496,12 @@ static void do_test(int family, unsigned int report_opt) total_len = cfg_payload_len; if (cfg_use_pf_packet || cfg_proto == SOCK_RAW) { total_len += sizeof(struct udphdr); - if (cfg_use_pf_packet || cfg_ipproto == IPPROTO_RAW) + if (cfg_use_pf_packet || cfg_ipproto == IPPROTO_RAW) { if (family == PF_INET) total_len += sizeof(struct iphdr); else total_len += sizeof(struct ipv6hdr); - + } /* special case, only rawv6_sendmsg: * pass proto in sin6_port if not connected * also see ANK comment in net/ipv4/raw.c