From patchwork Mon Apr 26 16:01:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 43135 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12D5C3892469; Mon, 26 Apr 2021 16:02:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12D5C3892469 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619452922; bh=2NSGGvaouQ8nPmwsHB9JNkQ6fg+krtH19ms/LlAjkm8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZygpOtoi0LgHrCEXqMmH9usFi9I8I/VJ0QXbo992sl3jYv+PbvXCC8vPiLfI/86Sf N51HbGvVuRdT0XN+VH3Fg6qEAw7LBGwMGTEgoPR3TPpFrkkVBdx5cUteHYRDvV1K53 KkWATGn2Y6g5JL5o8w8wgNu+Ssg/jeD1W3zRIQtE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id AA916383801C for ; Mon, 26 Apr 2021 16:01:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA916383801C Received: by mail-io1-xd2f.google.com with SMTP id z14so3987707ioc.12 for ; Mon, 26 Apr 2021 09:01:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2NSGGvaouQ8nPmwsHB9JNkQ6fg+krtH19ms/LlAjkm8=; b=t3cUXhtxo8caWCcK0GMPbd8eR9inmFshUChgDRrgYR1qCtxGQC8TAI0CYmoxUNj02v OQ6Bsdg9/ryFXA/2tAryAIkfPxIrrJZHqV8v2Sq+GU2b4hclDfr7YCkmXhXDeAEaO3Lr 7ZIzUOstUZkVeuJrKhZc5AuPXKL5akbRFgXkHkAu8+83EK/zJTYo9/k0PasJ/UGG9nS9 9Vu5+GKZgYdoJq0piL5OXeky5DDrFNZc8gS94CWmbd0571cZF0F37MLaYic6TImWlkb7 CJn8S6IIwr5R0yyYPgecnMP/xGbBex52aI1S4g3neJJnWW/o/HxlKJK3yks2zqS82gZP VG2w== X-Gm-Message-State: AOAM532aMMiuguI6txEsM2QPvpW8JGCAjCoBZcNIgNIE+vneEO4griW3 TuuogheTZoSjywR3zEeVaJtCM0oi8DQ= X-Google-Smtp-Source: ABdhPJwid0v6HfvzoMUTkm8BoxRRGdCw9ytLGqFcoWn/u2uw8pYOVfaCsZ3BzLhd1AMwsy3JzdovYw== X-Received: by 2002:a5e:8a48:: with SMTP id o8mr14901703iom.103.1619452919076; Mon, 26 Apr 2021 09:01:59 -0700 (PDT) Received: from aroeseler-ly545.hsd1.ut.comcast.net ([2601:681:8800:baf9:1ee4:d363:8fe6:b64f]) by smtp.googlemail.com with ESMTPSA id x13sm128250ilq.85.2021.04.26.09.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 09:01:58 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH V2] Add RFC 8335 Definitions from Linux 5.12 Date: Mon, 26 Apr 2021 11:01:46 -0500 Message-Id: <20210426160146.2934-1-andreas.a.roeseler@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andreas Roeseler via Libc-alpha From: Andreas Roeseler Reply-To: Andreas Roeseler Cc: fweimer@redhat.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" RFC 8335 defines the network utility PROBE, which builds off of the capabilities of Ping to query more detailed interface information from networking nodes. The definitions included in this patchset have been accepted into the linux net-next branch and will be included in Linux 5.12. This patchset adds the same definitions to the glibc for use in the iputils package. The relevant commits for the Linux definitions can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2b246b2569cd2ac6ff700d0dce56b8bae29b1842 https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=750f4fc2a12f6632b5aa04526bf57fa06bfe8467 These changes have been tested by running the glibc tests on x86_64 Signed-off-by: Andreas Roeseler --- Changes: v1 -> v2: - Add more specific prefixes to constants --- inet/netinet/icmp6.h | 2 ++ sysdeps/gnu/netinet/ip_icmp.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/inet/netinet/icmp6.h b/inet/netinet/icmp6.h index 22b82335ec..f0df16123e 100644 --- a/inet/netinet/icmp6.h +++ b/inet/netinet/icmp6.h @@ -69,6 +69,8 @@ struct icmp6_hdr #define MLD_LISTENER_QUERY 130 #define MLD_LISTENER_REPORT 131 #define MLD_LISTENER_REDUCTION 132 +#define ICMP6_EXT_ECHO_REQUEST 160 +#define ICMP6_EXT_ECHO_REPLY 161 #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ #define ICMP6_DST_UNREACH_ADMIN 1 /* communication with destination */ diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h index 5db7ac7c37..ec7137253f 100644 --- a/sysdeps/gnu/netinet/ip_icmp.h +++ b/sysdeps/gnu/netinet/ip_icmp.h @@ -89,6 +89,24 @@ struct icmphdr #define ICMP_EXC_TTL 0 /* TTL count exceeded */ #define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */ +/* Codes for ICMP_EXT_ECHO (PROBE) */ +#define ICMP_EXT_ECHO 42 +#define ICMP_EXT_ECHOREPLY 43 +#define ICMP_EXT_CODE_MAL_QUERY 1 /* Malformed Query */ +#define ICMP_EXT_CODE_NO_IF 2 /* No such Interface */ +#define ICMP_EXT_CODE_NO_TABLE_ENT 3 /* No table entry */ +#define ICMP_EXT_CODE_MULT_IFS 4 /* Multiple Interfaces Satisfy Query */ + +/* Constants for EXT_ECHO (PROBE) */ +#define ICMP_EXT_ECHOREPLY_ACTIVE (1 << 2)/* active bit in reply */ +#define ICMP_EXT_ECHOREPLY_IPV4 (1 << 1)/* ipv4 bit in reply */ +#define ICMP_EXT_ECHOREPLY_IPV6 1 /* ipv6 bit in reply */ +#define ICMP_EXT_ECHO_CTYPE_NAME 1 +#define ICMP_EXT_ECHO_CTYPE_INDEX 2 +#define ICMP_EXT_ECHO_CTYPE_ADDR 3 +#define ICMP_AFI_IP 1 /* Address Family Identifier for IPV4 */ +#define ICMP_AFI_IP6 2 /* Address Family Identifier for IPV6 */ + #ifdef __USE_MISC /*