Subject: Re: tcp_input.c: simplify a v6 check slightly? [patch]
To: Hubert Feyrer <email@example.com>
From: Jonathan Stone <firstname.lastname@example.org>
Date: 05/19/2005 11:36:42
>There is not change functionality, only make the code a bit easier to
>understand. The patch below does this. Any objections to commit?
If you see a good reason to make this change (which you connccede are
semantically pointless): why not change all nine ocurrences of
``#ifndef INET6'' in sys/netinet/*.[ch], instead of just picking one
out, apparently at random? By my count, a good six of them are
sylistically very similar: checking inp and inp6, vs just inp for
IPv4; or possibly with an addtional test (req != PRU_ATTACH).
Hubert, I must be missing something here. Can you help me see the
benefit in `simplifying' this one usage, but not the other very
similar usages? I'm just not seeing it as much of a help, given that
the mix of a half-dozen-odd other, positive and negative tests are
Maybe a macro, NULL_INP(inp, in6p) which sinelty discards its second
argument altogether for the non-IPv6 case, and did a consistent check
(always positive, or always negative, as you prefer) would be more
Or then again, if there's only a half-dozen uses... why bother?