Re: [patch] iptables version defines

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

 



Thomas Jarosch wrote:
Hi Patrick,

#ifdef _XTABLES_H
init(struct xt_entry_target *t)
#else
init(struct ipt_entry_target *t, unsigned int *nfcache)
#endif
Woah this is ridiculously ugly. (Remember, such constructs were
just eliminated from the kernel in the past years.)
I don't care about uglyness as long as it stays in external
code. So if someone sends me a patch to add this version
define, I'll add it.

External code has to be "ugly" if you want to keep the user experience high.
I don't feel like breaking ipt_ACCOUNT for older iptables versions without
any real gain, it should work out of the box with iptables 1.4.0 and 1.4.1.

Attached is a patch to add the new defines. The macro XTABLES_VERSION is already in use, so I named it XTABLES_VERSION_CHECK. I've also tested
that an empty XTABLES_VERSION_EXTRA in configure.ac works.

Now we can write code like this:

#if XTABLES_VERSION_CODE < XTABLES_VERSION_CHECK(1,5,0)
    #warning You are obselete and will be assimilated.
#endif


Looks good to me - I'll let it sit on netfilter-devel until tonight
though since my auto* knowlegde is close to zero :)
--
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