Re: [patch] iptables version defines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 2008-06-02 17:32, Thomas Jarosch wrote:
>Jan,
>>
>> #define XTABLES_API_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
>
>As you already pointed out, it's a matter of taste and neither
>of both versions will hurt as it will be expanded at compile time.
>
>Infact, imagine we would add another version level like "(x) << 32",
>on x86 it is only valid to do a left shift operation for 0-31 bits
>and so it could fail...

First, you would use << 24 not << 32 :-)
Even so, << 32 is perfectly valid if you correctly declare it as a
unsigned long long.

>> >+#define XTABLES_VERSION_MAJOR(x)  (((x)>>16) & 0xFF)
>> >+#define XTABLES_VERSION_MINOR(x)  (((x)>> 8) & 0xFF)
>> >+#define XTABLES_VERSION_PATCH(x)  ( (x)      & 0xFF)
>>
>> I do not see a need for these three. The linux kernel does not
>> have such either, so please don't overdesign :)
>
>Well, I've created the same macros as there are already in include/iptables.h.

That's just leftover, they are not used either.

>I'm alright with your proposed change to XTABLES_API_VERSION
>and the drop of _MAJOR, _MINOR and _PATCH macros as
>one can easily check for same thing via "xyz < XTABLES_API_VERSION(2,6,0)"
>
>Attached is an updated patch.

I approve.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux