From patchwork Wed Feb 17 18:08:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 384244 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 A650AC433E9 for ; Wed, 17 Feb 2021 18:08:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78E2E64E5B for ; Wed, 17 Feb 2021 18:08:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234776AbhBQSIr (ORCPT ); Wed, 17 Feb 2021 13:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234761AbhBQSIo (ORCPT ); Wed, 17 Feb 2021 13:08:44 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 981F7C0613D6 for ; Wed, 17 Feb 2021 10:08:04 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id t25so8994998pga.2 for ; Wed, 17 Feb 2021 10:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6OppbIT1M1gvXOWsdS8QHmLhNPa/v+vgtcvDuscwBAU=; b=UqtIF1fr5ZmskUEOK8hSkSQ8fRyP/pvxLOfAusV3ShQaA0M/mSrmMhf03LQ6TAxvLq WdudHxyU5d44PHDb0t/Zwjf+Zii8Gr5DMZb4h80GWVKsO/CrCVuuCK0Z0U1on5YtHyNM lDcCcvXS6RfSdWmhZrANEfSQ0jVBbvsxLS0nt5gwCz4HHBi3XMlZmQRtU5WKoW0nPqpa 8CylD5V5Cr5aH8aRGiwtIhHH6BXwcsSuOAW1kuxgT/aScDCNpcjZW5cAyLbYt/sMsMyZ 3hsZTj1S3Dji9Ej70ztpEtoyx7UE740q/PmfZpiBJiM1egjuukUxbqPZPwf9RimJejnu niYQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6OppbIT1M1gvXOWsdS8QHmLhNPa/v+vgtcvDuscwBAU=; b=C8gEEmxnues5Nek+JiZMFu3RJf3CH3joZ+l86VmuQvRZ0d/sISGJi9nVVblzuwt7BK KgiZw8yVkrMjm6QwmKoUVENwfou1AKZQwp+pVz02oDtaLuhR2DShjlyegQwYj7RyVQvL ErcX6xEIFbMEFkUWSrYtQym1pChu125YvEt+ahUstTe5CBKTz/OApivx57WOThmrwlUt KJY9yDRpjSQ8/4Rg0KLhjQDQDbWE4z0Dxi4YVo3tZJPGclryImkmSHRB9nAPzB9Fvu3Z ryDkqWajDrjg8gmj2hzK8YS+s1CZCnvLgIH/sXMP6pKdVKk6L6xkmw8M87CyWzDuM8kC wP0Q== X-Gm-Message-State: AOAM53293Ifiz8Ov20eG1EQlEj96KEZ2twu5+NVefE+rf6OSgijWIIpy 52bmyy6aNafpXgYbDuOgk4Q= X-Google-Smtp-Source: ABdhPJwPH0jjNOVx6BoIrg3vvVurrhycb+v2NB2NtP5Ivk9BTPDKdHQIjOBE5vVoLK00rMx8OdJ05w== X-Received: by 2002:a05:6a00:2286:b029:1ae:6c7f:31ce with SMTP id f6-20020a056a002286b02901ae6c7f31cemr507610pfe.6.1613585284239; Wed, 17 Feb 2021 10:08:04 -0800 (PST) Received: from localhost.localdomain (h134-215-166-75.lapior.broadband.dynamic.tds.net. [134.215.166.75]) by smtp.gmail.com with ESMTPSA id m23sm3181293pgv.14.2021.02.17.10.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 10:08:03 -0800 (PST) From: Andreas Roeseler To: davem@davemloft.net Cc: yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org Subject: [PATCH V3 net-next 2/5] ICMPV6: add support for RFC 8335 PROBE Date: Wed, 17 Feb 2021 10:08:03 -0800 Message-Id: <8eb733939ea7b22513ba6682571d1a44f651cf55.1613583620.git.andreas.a.roeseler@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add definitions for the ICMPV6 type of Extended Echo Request and Extended Echo Reply, as defined in sections 2 and 3 of RFC 8335. Signed-off-by: Andreas Roeseler --- include/uapi/linux/icmpv6.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h index 0564fd7ccde4..b2a9017ddb2d 100644 --- a/include/uapi/linux/icmpv6.h +++ b/include/uapi/linux/icmpv6.h @@ -140,6 +140,12 @@ struct icmp6hdr { #define ICMPV6_UNK_OPTION 2 #define ICMPV6_HDR_INCOMP 3 +/* + * Codes for EXT_ECHO (PROBE) + */ +#define ICMPV6_EXT_ECHO_REQUEST 160 +#define ICMPV6_EXT_ECHO_REPLY 161 + /* * constants for (set|get)sockopt */ From patchwork Wed Feb 17 18:08:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 384243 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 C26ECC433E0 for ; Wed, 17 Feb 2021 18:09:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8466D64DEC for ; Wed, 17 Feb 2021 18:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233069AbhBQSJK (ORCPT ); Wed, 17 Feb 2021 13:09:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232913AbhBQSI6 (ORCPT ); Wed, 17 Feb 2021 13:08:58 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 833C6C061788 for ; Wed, 17 Feb 2021 10:08:18 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id m2so8982680pgq.5 for ; Wed, 17 Feb 2021 10:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cCET9WBqWjygW6XCStVpWhmRU/4x/+TmAJlTpAVop6s=; b=p+IaIuWFFkmokc3g4KwFW6xT4Tn0Q5L7nmb+PFWe4DDAek9JQxTI7OaObBWnEk4iBN cCQLMT32L8JdRRD9SLR0yiCq6t75mVo7E5cxblodQutlJPGfRLXEdW67SoOV/0UVpx+F tezdyTB+JclEV7CsS7UrkWNJ3liO0FkYfOrQzzovepfur5fD5xAA0vwcDsg9QXODrTiX BvgNIMbAPNcd8JHqewK5O7q4aqNAGWUHzUzijIDTwYCmy4rE4HKGvIAksz04amobnMT0 FrkCHgf2eFD4HceY0VDaRVaEH294g7+x280SjKCeq3zbyawW6XwyPclarWAbuk21kiMf eyTA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cCET9WBqWjygW6XCStVpWhmRU/4x/+TmAJlTpAVop6s=; b=M6H+g7Zz6X2tW0hl9/ccppF1zjnWnss5Jmhhh0rNrw1QrCkWtUXA4qwTPTSna67pci oABXn3nHKhadxmpJpcstA7qnW6c+foZN9CwZCoAkZdVBtfz+qT9GA2ll2nINe4Nb2G6Z d0kuVfNEz1OXoiGcgxGv6g9qepJ8BipHsohQl7KVYy79W4pBRlWtsIsdINsdQc55B5Y8 pu0zuiMivlJUqzGBRZEGw8NujCBpM2coBJkN5VVA36Dp/NA3q7jSVJnjEuyn3ix11R1d 5yoFAtIOQLprqtxgssAxWaI4l22NOBbQOl2A0MfvPu40azMb8eacuoBqEFfJ1zf6/dZ7 afIQ== X-Gm-Message-State: AOAM5310HabAv1J2lYnpmafO4N9we75BxlSRtiDkv9njTG8fDYujerLV KlGIFYNrYpKZDejb95ISjIo= X-Google-Smtp-Source: ABdhPJwO7YJsdZRY2QF410cH7sMhkTu2z5r+XEn6NbmaAn07Kwl8WN+GXYAlKUshCRoTd0fdaQJaDA== X-Received: by 2002:a63:2254:: with SMTP id t20mr537205pgm.230.1613585298158; Wed, 17 Feb 2021 10:08:18 -0800 (PST) Received: from localhost.localdomain (h134-215-166-75.lapior.broadband.dynamic.tds.net. [134.215.166.75]) by smtp.gmail.com with ESMTPSA id s7sm3218558pgb.89.2021.02.17.10.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 10:08:17 -0800 (PST) From: Andreas Roeseler To: davem@davemloft.net Cc: yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org Subject: [PATCH V3 net-next 4/5] net: add support for sending RFC 8335 PROBE messages Date: Wed, 17 Feb 2021 10:08:16 -0800 Message-Id: <4b9b6324310cfea00e8f8a0c0dea2c35134ee2e0.1613583620.git.andreas.a.roeseler@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Modify the ping_supported function to support PROBE message types. This allows tools such as the ping command in the iputils package to be modified to send PROBE requests through the existing framework for sending ping requests. Signed-off-by: Andreas Roeseler --- net/ipv4/ping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 8b943f85fff9..1c9f71a37258 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -453,7 +453,9 @@ EXPORT_SYMBOL_GPL(ping_bind); static inline int ping_supported(int family, int type, int code) { return (family == AF_INET && type == ICMP_ECHO && code == 0) || - (family == AF_INET6 && type == ICMPV6_ECHO_REQUEST && code == 0); + (family == AF_INET && type == ICMP_EXT_ECHO && code == 0) || + (family == AF_INET6 && type == ICMPV6_ECHO_REQUEST && code == 0) || + (family == AF_INET6 && type == ICMPV6_EXT_ECHO_REQUEST && code == 0); } /*