[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2f720705-cee2-75b7-c32c-793dcaeb8ea7@rasmusvillemoes.dk>
Date: Thu, 29 Sep 2022 13:11:53 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Network Development <netdev@...r.kernel.org>
Cc: Lorenzo Colitti <lorenzo@...gle.com>,
Vasiliy Kulikov <segoon@...nwall.com>
Subject: purpose of ping_hash() in net/ipv4/ping.c
Hi
I'm wondering about the purpose of the function ping_hash() in
net/ipv4/ping.c. It only contains an unconditional BUG(), with a comment
that doesn't help much.
It was there with the original commit c319b4d76b9e (net: ipv4: add
IPPROTO_ICMP socket kind), but then renamed and made non-static for
"use" by IPv6 in 6d0bfe226116 (net: ipv6: Add IPv6 support to the ping
socket.)
The latter commit also added the 'EXPORT_SYMBOL_GPL(ping_hash);' in a
somewhat non-standard location (namely, after the the similarly named
ping_hashfn()), which is why I stumbled on this oddity.
Can we just remove ping_hash() and stop setting .hash of in ping_prot
and pingv6_prot? I don't think there's much difference between a NULL
deref and an explicit BUG a few instructions later.
And if we can't, can someone perhaps improve the comment and move the
export to the right place?
Rasmus
Powered by blists - more mailing lists