From patchwork Sun Mar 14 16:48:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 400340 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.8 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 46B9DC28E80 for ; Sun, 14 Mar 2021 16:49:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12CF064DE8 for ; Sun, 14 Mar 2021 16:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234060AbhCNQsq (ORCPT ); Sun, 14 Mar 2021 12:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbhCNQs3 (ORCPT ); Sun, 14 Mar 2021 12:48:29 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D660BC061574 for ; Sun, 14 Mar 2021 09:48:27 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id c17so1530030pfv.12 for ; Sun, 14 Mar 2021 09:48:27 -0700 (PDT) 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; bh=Lio5CHdjePdGCdvRLilg1iaYE0Vy2lHPlsFlnZ4SNRQ=; b=WXo3hHewXk9JvkosPyM3N26wSKX9FJrpk2chPVLlk+EeMjmGKC4Vh8/0T1hEoFNVOd +4Lr6HyMsB0KbI2fFbQtJPjL0b81iCRlkhI3TIaykpuoV+u07mjLNRJnRtx/xKQnai0Z g9dx3951ZMQE1B3EHnJ94MH9J6IJEwjTLxXi3SOXMYMPAeK98DuPPslG796h2rAKmuw4 IfYqtR1qTbjk7NxxmXEQk5ARFDgD3BRDetdcXeeQJ4hZ6gcGn4GSZqUCS3V10WCq23IO 5GdgC/f0VtEq8t/Al9LTbapsXjhtNLC1JE4ouSIIvuhV7ToI4sFWZXdp4jIxAm601sZS cQSQ== 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; bh=Lio5CHdjePdGCdvRLilg1iaYE0Vy2lHPlsFlnZ4SNRQ=; b=dZcW3EBnMbde1i+Cu/Q5llAnzPjVXzDmcDwYgQKkfkXmH6413+e+OZDDt6nhVTGcIm yLMyoowhPXEg7Y4G6Ae52+NiANkqR9NA+JR95YS5AuacDxMaBFsVgVCXuUFFj6CxPejy ISbHPQB5blFb+jHVUlSIDPG4TfyA56GEuRwa5w8Nnd9KGrs3Is1NQMfMIMoM8ji1KVUT y53lIom5mMuI+yN5bO5zjEyfngMdZFLGpp7LvVveOWdK9evDbrhI0SqXPie9dtDV9eTo DyIAABUH/nnb5J4qF9mMekKDFJKPM6AmI6ZbNp7T9BmLU+SDZ3qF/R9hPtyTiVcZS0zL kDnA== X-Gm-Message-State: AOAM532FqQtYL1Cz/K3vrSSrsiT7Q7H58XajwebeWBH/KYBTTmiNRKt8 vH7Z8vNuPJyZadciH0sX284= X-Google-Smtp-Source: ABdhPJyR2Ire1Ced0+ItTIMqwyazr2doSeyj8Jvsq3Y5CHFB6/v9TG+o0Um3uYbf5MixFQpxLdIS4w== X-Received: by 2002:a63:4406:: with SMTP id r6mr4870308pga.146.1615740507537; Sun, 14 Mar 2021 09:48:27 -0700 (PDT) Received: from clinic20-Precision-T3610.hsd1.ut.comcast.net ([2601:681:8800:baf9:ed7e:5608:ecd4:c342]) by smtp.googlemail.com with ESMTPSA id f19sm11339573pgl.49.2021.03.14.09.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 09:48:27 -0700 (PDT) From: Andreas Roeseler To: davem@davemloft.net Cc: yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, Andreas Roeseler Subject: [PATCH V4 net-next 2/5] ICMPV6: add support for RFC 8335 PROBE Date: Sun, 14 Mar 2021 09:48:24 -0700 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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 by sections 2 and 3 of RFC 8335. Signed-off-by: Andreas Roeseler --- include/uapi/linux/icmpv6.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h index 0564fd7ccde4..ecaece3af38d 100644 --- a/include/uapi/linux/icmpv6.h +++ b/include/uapi/linux/icmpv6.h @@ -140,6 +140,9 @@ 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 Sun Mar 14 16:48:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Roeseler X-Patchwork-Id: 400339 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.8 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 1F17FC433E6 for ; Sun, 14 Mar 2021 16:49:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEEDA64DE8 for ; Sun, 14 Mar 2021 16:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234692AbhCNQtS (ORCPT ); Sun, 14 Mar 2021 12:49:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234479AbhCNQsn (ORCPT ); Sun, 14 Mar 2021 12:48:43 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 904F8C061574 for ; Sun, 14 Mar 2021 09:48:43 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id o10so1934723plg.11 for ; Sun, 14 Mar 2021 09:48:43 -0700 (PDT) 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; bh=BzVco/Eg/onFpe1i6nNSzFOzajJSuv5MLzRUu8zpDpk=; b=TdOb8p4vzXEfDJiAPiX9eNFFI4iQOx8sk71JPvs6hTRwGVblfLFIzRlY+pfj7PIGiV mAhHdxdibT4OM9hyFB/7UAfQmAnsCnxYQ761En71Tz1vVYNshbDtMUOF2+TzRu+nybYk hubiSDkW+jAZJRkcfhnuW7gsWYWXghMYqdLCUlNC1H22DdDNJMl/++uU1ah0ztGRLuED PcpE8YibH++hepSa+rjgy373AiMv0ecHaC6hG6sNg9jgTtZN7/DczF3qRghVm/enDyjH 88VWdzCDExtImcViWjdvfthcav/nGG4R15rH1BFOt5hTgd08G+dQEG2VHjCtBBgh+xwn b9sQ== 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; bh=BzVco/Eg/onFpe1i6nNSzFOzajJSuv5MLzRUu8zpDpk=; b=Uu0WsU9Nm59vVwsW60GM3InuUtsgdKTjPpPtVp7jCd5LsqvQASydCzAc8YUzT0OF0p dYWoJV/KXPXHddjweUvmgN2kHaznnag/9zlxtdPB/PdSRKgPV2JS3Iv7gb77ietfwaov dMOYl3ILqNOdm5Q7hyRrGpmbmIntJT00CjM6LTWBf2VJ98YTGtPb5XwiSy80YGvnl/QX 38BpCCtit8ASQeLN+XpDolpAAXNrJgDnYpskPnAGCdWBmEm0yzaOe1Y+4XMN+dOBJ7ex 8SQVC8m+TCa/GCsknLbh10JwU5eUFEAxKJ83nj2A2GhSpzEztQjnCT0CV13ldC3qlz9i r0xA== X-Gm-Message-State: AOAM532Di7zqHibk8fywr2MiY+iLmsriLBcuR3jTs0e8VbZbIBYUD+lj 4iyOY3teaz6uQFDhIRcAKY4= X-Google-Smtp-Source: ABdhPJxlPAksuRSJSCn1mhtEZLS5N9M+E7RpSmIV9IauRUeAjYhYzycG/ZLVlaT7/yEP1BPm0meh5Q== X-Received: by 2002:a17:90a:1696:: with SMTP id o22mr8509872pja.0.1615740523202; Sun, 14 Mar 2021 09:48:43 -0700 (PDT) Received: from clinic20-Precision-T3610.hsd1.ut.comcast.net ([2601:681:8800:baf9:ed7e:5608:ecd4:c342]) by smtp.googlemail.com with ESMTPSA id bb24sm8095469pjb.5.2021.03.14.09.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 09:48:42 -0700 (PDT) From: Andreas Roeseler To: davem@davemloft.net Cc: yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, Andreas Roeseler Subject: [PATCH V4 net-next 4/5] net: add support for sending RFC 8335 PROBE messages Date: Sun, 14 Mar 2021 09:48:40 -0700 Message-Id: <4b2fb4075c9ebd607290667ae72cd20d388aeb73.1615738432.git.andreas.a.roeseler@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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); } /*