]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ping: remove pr_err from ping_lookup
authorXin Long <lucien.xin@gmail.com>
Thu, 24 Feb 2022 03:41:08 +0000 (22:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:33:54 +0000 (11:33 +0100)
commit cd33bdcbead882c2e58fdb4a54a7bd75b610a452 upstream.

As Jakub noticed, prints should be avoided on the datapath.
Also, as packets would never come to the else branch in
ping_lookup(), remove pr_err() from ping_lookup().

Fixes: 35a79e64de29 ("ping: fix the dif and sdif check in ping_lookup")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/1ef3f2fcd31bd681a193b1fcf235eee1603819bd.1645674068.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ping.c

index 1ee488a539363c07c1e2c7482f7b4e466058fb48..0dd5ca2004c73e6b4487517be3cda8416552fae0 100644 (file)
@@ -192,7 +192,6 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
                         (int)ident, &ipv6_hdr(skb)->daddr, dif);
 #endif
        } else {
-               pr_err("ping: protocol(%x) is not supported\n", ntohs(skb->protocol));
                return NULL;
        }