[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4b9b6324310cfea00e8f8a0c0dea2c35134ee2e0.1613583620.git.andreas.a.roeseler@gmail.com>
Date: Wed, 17 Feb 2021 10:08:16 -0800
From: Andreas Roeseler <andreas.a.roeseler@...il.com>
To: davem@...emloft.net
Cc: yoshfuji@...ux-ipv6.org, dsahern@...nel.org, kuba@...nel.org,
netdev@...r.kernel.org
Subject: [PATCH V3 net-next 4/5] net: add support for sending RFC 8335 PROBE messages
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 <andreas.a.roeseler@...il.com>
---
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);
}
/*
--
2.25.1
Powered by blists - more mailing lists