From patchwork Wed Nov 18 00:47:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 11913721 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=-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 206E4C6379F for ; Wed, 18 Nov 2020 00:47:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFB8D24682 for ; Wed, 18 Nov 2020 00:47:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CKJartWL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729238AbgKRArP (ORCPT ); Tue, 17 Nov 2020 19:47:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbgKRArO (ORCPT ); Tue, 17 Nov 2020 19:47:14 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8187CC061A48; Tue, 17 Nov 2020 16:47:14 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id t21so14228pgl.3; Tue, 17 Nov 2020 16:47:14 -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=hjCuBppI/3uQsW5cJkIoidG2uXiaB12HKAMzYdLQZ54=; b=CKJartWL0TXPsIcB7k70hBzfGA6ga7Oe/CRB5brq0sVTLLkejgDcHNRQl1erpwncy6 M3Bhlp31IVj3Fh1utSwgLoaEdAaujO51qaYCy5kHy2N4yJps1YacgSfyDNsCDMAMkGFP ggF3lg9GHBrUHsvYQlzHGzBpKtDw8vkt0L8nSG97NjVWcVl6SlHYzIzWTS9BAuEsUcSo XfLC6MDQ9juvDpCzr0lgNaB+lrbaZqek4canPJ9WGQMtfk5Hv5XNBE+vWLizvLu11IlQ W94EJLhKh9uchNu3hTiMQucfM3MszV2gLw7AVCETklVFRHo8ZxTuCPAy17W8cACQymtZ xFDA== 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=hjCuBppI/3uQsW5cJkIoidG2uXiaB12HKAMzYdLQZ54=; b=NOGOpoRSOmuJkxrDHxg+3aJ9QcGdjNtfhJyl6RB/+p9J8TDhGz5LmdFrhJmJqh2/2e +s3VlCaVP+7uYZFrkpAnUw2dqje5IqmLCmYGxzALq7i/3sNW+FBmSSGXZFarQaQqK1hX NSS90l5PwQuEGpMIhmigyyhJNRiBssj7nV5HWNj831TEIJpmfaljV0WSM50hOcg2WZYV sHp9J3441uTQmJFT4M8WrjouuQ6CKVAOycfFn27iDwMHfx8p6TGGarLP2NUOpr9NtS2v Rxm7rSJTqMO3keuql3bDoRC2YKOSDEoSdINbHNlHtFbSnd26uHAwMorNatBXZr+lCpAZ BLSw== X-Gm-Message-State: AOAM530A+qyQY2cemtAI83QBiXcXw4OrySTDtvcttv1GjOQ7xg9Jfmcm dh1CwU6S7VQNyaDaeiDyLcqptkwgWblV8w== X-Google-Smtp-Source: ABdhPJy+DA1iyqPbe44+AZuCsTd5V0iQMMd/n6amSJXtQrOvhlWkABzg47MWua4ziNYyEubrw37RqQ== X-Received: by 2002:a62:8c08:0:b029:197:491c:bab1 with SMTP id m8-20020a628c080000b0290197491cbab1mr2112324pfd.49.1605660434140; Tue, 17 Nov 2020 16:47:14 -0800 (PST) Received: from aroeseler-LY545.hsd1.ca.comcast.net ([2601:648:8400:9ef4:34d:9355:e74:4f1b]) by smtp.googlemail.com with ESMTPSA id k30sm5673612pgb.83.2020.11.17.16.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 16:47:13 -0800 (PST) From: Andreas Roeseler To: davem@davemloft.net Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 net-next 1/3] icmp: define PROBE message types Date: Tue, 17 Nov 2020 16:47:12 -0800 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The types of ICMP Extended Echo Request and ICMP Extended Echo Reply are defined in sections 2 and 3 of RFC8335. Signed-off-by: Andreas Roeseler --- Changes since v1: - Switch to correct base tree Changes since v2: - Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553 Changes since v3: - Reorder patches to add defines first --- include/uapi/linux/icmp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h index fb169a50895e..1a84450f667f 100644 --- a/include/uapi/linux/icmp.h +++ b/include/uapi/linux/icmp.h @@ -66,6 +66,9 @@ #define ICMP_EXC_TTL 0 /* TTL count exceeded */ #define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */ +/* Codes for EXT_ECHO (Probe) */ +#define ICMP_EXT_ECHO 42 +#define ICMP_EXT_ECHOREPLY 43 struct icmphdr { __u8 type; From patchwork Wed Nov 18 00:47:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 11913723 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=-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=unavailable 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 EFEDEC56202 for ; Wed, 18 Nov 2020 00:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6B8F24198 for ; Wed, 18 Nov 2020 00:48:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QdP1Lpc/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729344AbgKRArW (ORCPT ); Tue, 17 Nov 2020 19:47:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgKRArV (ORCPT ); Tue, 17 Nov 2020 19:47:21 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C29C061A48; Tue, 17 Nov 2020 16:47:21 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id oc3so142119pjb.4; Tue, 17 Nov 2020 16:47:21 -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=dXRBv5PHzve2HVPaP5kpA6YTo3UMeEjMxAdlm/Mznh8=; b=QdP1Lpc/xVXK79Jig01UuC9v1Wo1u8NyVMEA8Ueayqas6eh7BR8syi54nQjhwvzBfr yI7bbF+4gDXs4VguPwldcPJVeb0qlqzDUZ1f39nmJzKCx0LBDq6Cxuvhx5wl6XMN/4SB 7uyAEt4nvMpO2nu39Kw1JaNZlnyDqW5eBRuGUz8zpJS78FwjzpUbbQTeZSdeQ8Lv6kvR fr04nkVxt7wIum7AolVM/taHld0/H8JE50r3I2SzNG/4hessmOYtjjwE92+m2Qv3e2sU hY7VsBNm4FL6Ke0dLn0HFA7gy+usl6ac1RvcE8bht9BU4X4/1Q+OKMJxQ3MAeCjHQXS0 Ghjw== 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=dXRBv5PHzve2HVPaP5kpA6YTo3UMeEjMxAdlm/Mznh8=; b=B/wS/+bxpykfoj9AE974PuaWb2wy8QPo010u4+9qMljFUNYJ1kqbL0LpujlLyK96YZ IUuoIcAIaAavhmVmG11f471emleBh9pxofLJr0y4TvVsbqc4kJ8+onVSdfIEl+ntccRp gmIb00Y2vBuoRZKK6jP4ZZI7o8q1BMcVEpvMZOSCscOE+O9uRPBeifgaMrk5Veqetbpr +niK3CtdcZkTdB2kJzK+3z+rNq7xzvNSK5meaAuMo81K3JR1QVqzuHI1IgqPMs4veP+s H1nxdqSquXcJShKXoHxOHgD0qGsL2aCU+vePzO14nRbY/j07ICTEfw5jsIbpSuTFX9yD zwMg== X-Gm-Message-State: AOAM533MxmNJzP3TD2ZaOCOvT7x0Ag6svPj2fDRD2eXJ9qYYPMJCryB8 XW3UJ1syNsS9UzcoJ2I9ClE= X-Google-Smtp-Source: ABdhPJwCiLmHyXiPZLS25i7e3K+epfYwguYS/GGL7DtkTcOEeoKoJSlpfY/NfHG8S1CpH5+BiLtANw== X-Received: by 2002:a17:90a:c914:: with SMTP id v20mr1573190pjt.112.1605660441000; Tue, 17 Nov 2020 16:47:21 -0800 (PST) Received: from aroeseler-LY545.hsd1.ca.comcast.net ([2601:648:8400:9ef4:34d:9355:e74:4f1b]) by smtp.googlemail.com with ESMTPSA id e7sm19688469pgj.19.2020.11.17.16.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 16:47:20 -0800 (PST) From: Andreas Roeseler To: davem@davemloft.net Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 net-next 2/3] ICMPv6: define PROBE message types Date: Tue, 17 Nov 2020 16:47:18 -0800 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The types of ICMPV6 Extended Echo Request and ICMPV6 Extended Echo Reply are defined in sections 2 and 3 of RFC8335. Signed-off-by: Andreas Roeseler --- Changes since v1: - Switch to correct base tree Changes since v2: - Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553 Changes since v3: - Reorder patches to add defines first --- 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..54dbafdedca1 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 Nov 18 00:47:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 11913725 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=-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 4ACD7C63697 for ; Wed, 18 Nov 2020 00:48:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EA912465E for ; Wed, 18 Nov 2020 00:48:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C3jo8906" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729411AbgKRAra (ORCPT ); Tue, 17 Nov 2020 19:47:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgKRAr3 (ORCPT ); Tue, 17 Nov 2020 19:47:29 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47EF4C061A48; Tue, 17 Nov 2020 16:47:28 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id y22so50138plr.6; Tue, 17 Nov 2020 16:47:28 -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=5VVUDsIQSbxm2kV6TXkpMyNop6FcshPxk4X8Om/Gvsg=; b=C3jo8906JKjYOkkYJIW9j2p4HK2VlJk9cY+Vbx1gNpN+dBsDkZctcOkWnY77EyQaf8 XAPkUoRy3Ua8vQVyH/L1njUgvRdyXxmhf1mr9XPhTafx21sLi1cxtBIJDS1X6cOJq6yc /9zs5N5oFfEmj9bPRp/Lnx/WJK3CXP0lTgZSRPDX/9PmyAIRUfIPOJj9FhDaAn2PliYZ XHwujUqfseA7CctUHuorAMx6hnfbCPuou6Tx82IGxtCXd1ijUoNHTEvujKgISTT1h9Ds 13PB6xRp8+apXZm4ZLdxUTvIkkB/EaChfr4RbrCxYfUEHcv0+SX1PsJyYCgQgIEwRMNl vJfQ== 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=5VVUDsIQSbxm2kV6TXkpMyNop6FcshPxk4X8Om/Gvsg=; b=WtlKi3m4ZPT3PpyHX2HaahKPyNfD172QWmbxiKKiIvGxuoedbWgFHqCZDRiOLZCC3A GCQN/n+eyDA9KcxLLNrQRWhGh9JSrDvoigY3hXmkwfOPrW1Z2y2pLsIAkr/P76Hgyp7F pVYR01EtpRiBkkg0TNF6r6+yO+QX3SAyhOisFtcX3BDIpnPlvoDwkKnO/1rjbtDTYfWM NqESgLc1m63CC5FPBZ04veMIa/vxJfjOHV3+ZQtVj3zCHJMTWpp1GRYKDqRK4zggEmZi uUFbgkcwGiwGQ+MeRjK4/EQXMgtoShedRjIUuyXpJELlHwpuZqv05Z8Xqq/lOGax5ZA9 b9IA== X-Gm-Message-State: AOAM533Q03/MOyP8ax3Jol4YkfmpQ/cG7gRiNlmeJPo21ZTv+BT7i+JE 8ukNGrt5UOvnp3rfy4/EmScic81pkcpnvQ== X-Google-Smtp-Source: ABdhPJy5UWxuFtmpm7KypkH7TEKSVPcZs2RVxxqutxJLsY9riHHM0IT5Bvga844ocE2sOv79zwISoA== X-Received: by 2002:a17:90a:5217:: with SMTP id v23mr1581575pjh.160.1605660447897; Tue, 17 Nov 2020 16:47:27 -0800 (PST) Received: from aroeseler-LY545.hsd1.ca.comcast.net ([2601:648:8400:9ef4:34d:9355:e74:4f1b]) by smtp.googlemail.com with ESMTPSA id y124sm22355993pfy.28.2020.11.17.16.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 16:47:27 -0800 (PST) From: Andreas Roeseler To: davem@davemloft.net Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 net-next 3/3] net: add support for sending RFC8335 PROBE Date: Tue, 17 Nov 2020 16:47:26 -0800 Message-Id: <9b256be32638926353a24c5600a689e7b339d595.1605659597.git.andreas.a.roeseler@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Modifying the ping_supported function to support probe message types allows the user to send probe requests through the existing framework for sending ping requests. Signed-off-by: Andreas Roeseler --- Changes since v1: - Switch to correct base tree Changes since v2: - Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553 Changes since v3: - Reorder patches add defines first --- 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 248856b301c4..39bdcb2bfc92 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); } /*