X-Git-Url: http://developer.intra2net.com/git/?p=ipt_ACCOUNT;a=blobdiff_plain;f=linux-2.6%2Fnet%2Fipv4%2Fnetfilter%2Fipt_ACCOUNT.c;h=3cd8a61e2c9fe7ac2535d18a27be6bf61bde6621;hp=78f2bb345d62b65b81b4d8f047712612b8689902;hb=146aa6772bdd87b14a91ac0a50df80a79a0ab7f8;hpb=ab1449e79dc308983a3ba1608cdb42be92bfc359 diff --git a/linux-2.6/net/ipv4/netfilter/ipt_ACCOUNT.c b/linux-2.6/net/ipv4/netfilter/ipt_ACCOUNT.c index 78f2bb3..3cd8a61 100644 --- a/linux-2.6/net/ipv4/netfilter/ipt_ACCOUNT.c +++ b/linux-2.6/net/ipv4/netfilter/ipt_ACCOUNT.c @@ -188,15 +188,31 @@ static int ipt_acc_table_insert(char *name, u_int32_t ip, u_int32_t netmask) } static int ipt_acc_checkentry(const char *tablename, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) const void *e, +#else + const struct ipt_entry *e, +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) const struct xt_target *target, +#endif void *targinfo, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) unsigned int targinfosize, +#endif unsigned int hook_mask) { struct ipt_acc_info *info = targinfo; int table_nr; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + if (targinfosize != IPT_ALIGN(sizeof(struct ipt_acc_info))) { + DEBUGP("ACCOUNT: targinfosize %u != %u\n", + targinfosize, IPT_ALIGN(sizeof(struct ipt_acc_info))); + return 0; + } +#endif + spin_lock_bh(&ipt_acc_lock); table_nr = ipt_acc_table_insert(info->table_name, info->net_ip, info->net_mask); @@ -213,15 +229,26 @@ static int ipt_acc_checkentry(const char *tablename, return 1; } -static void ipt_acc_destroy(const struct xt_target *target, void *targinfo, unsigned int targinfosize) +static void ipt_acc_destroy( +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) + const struct xt_target *target, +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) + void *targinfo) +#else + void *targinfo, + unsigned int targinfosize) +#endif { unsigned int i; struct ipt_acc_info *info = targinfo; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) if (targinfosize != IPT_ALIGN(sizeof(struct ipt_acc_info))) { DEBUGP("ACCOUNT: targinfosize %u != %u\n", targinfosize, IPT_ALIGN(sizeof(struct ipt_acc_info))); } +#endif spin_lock_bh(&ipt_acc_lock); @@ -413,9 +440,15 @@ static unsigned int ipt_acc_target(struct sk_buff **pskb, const struct net_device *in, const struct net_device *out, unsigned int hooknum, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) const struct xt_target *target, +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) + const void *targinfo) +#else const void *targinfo, void *userinfo) +#endif { const struct ipt_acc_info *info = (const struct ipt_acc_info *)targinfo; @@ -1020,7 +1053,9 @@ static int ipt_acc_get_ctl(struct sock *sk, int cmd, void *user, int *len) static struct ipt_target ipt_acc_reg = { .name = "ACCOUNT", .target = ipt_acc_target, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) .targetsize = sizeof(struct ipt_acc_info), +#endif .checkentry = ipt_acc_checkentry, .destroy = ipt_acc_destroy, .me = THIS_MODULE