Re: udp.c

From: Jesper Juhl
Date: Mon Jun 13 2005 - 12:25:44 EST


On 6/13/05, Måns Rullgård <mru@xxxxxxxxxxxxx> wrote:
> Rommer <rommer@xxxxxxxxx> writes:
>
> > Bernd Petrovitsch wrote:
> >> On Mon, 2005-06-13 at 14:24 +0200, Måns Rullgård wrote:
> >>
> >>>Bernd Petrovitsch <bernd@xxxxxxxxx> writes:
> >>>
> >>>
> >>>>On Mon, 2005-06-13 at 14:57 +0300, Rommer wrote:
> >>>>
> >>>>>Where used strange function udp_v4_hash?
> >>>>>linux-2.6.11.11, net/ipv4/udp.c:204
> >>>>>
> >>>>>static void udp_v4_hash(struct sock *sk)
> >>>>
> >>>>Since it is "static" the user must be in the same source file (or -
> >>>>theoretically - any included header).
> >>>
> >>>It's not that simple. It is assigned to the 'hash' field of a struct
> >> If you interpret "called" word-by-word yes. I assumed "used".
> >>
> >>>proto, which is exported. It could be used from anywhere, but
> >> The the OP has to grep for dereferences for this hash variable and
> >> check
> >> if it is (or may be) from the given struct.
> >> Well, that's the virtue of object-orientation: Follow the objects, not
> >> the functions/methods.
> >>
> >>>hopefully isn't. Something else is supposed to ensure that it is
> >>>never called when using the UDP protocol.
> >
> > So, why BUG(), not just void function?
>
> Calling the function would be the result of a bug elsewhere in the
> code, which should be detected and reported.
>
Why not remove the function and audit the code for users (and if any,
remove them)...? Let's get rid of it instead of having a function sit
around the only purpose of which is to BUG();

--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/