Re: [PATCH] chaostables

From: Patrick McHardy
Date: Thu Mar 08 2007 - 07:54:06 EST


Jan Engelhardt wrote:

> Index: linux-2.6.21-rc3/net/netfilter/xt_CHAOS.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3/net/netfilter/xt_CHAOS.c
> @@ -0,0 +1,184 @@
> +
> +static unsigned int xt_chaos_target(struct sk_buff **pskb,
> + const struct net_device *in, const struct net_device *out,
> + unsigned int hooknum, const struct xt_target *target, const void *targinfo)
> +{
> + /* Equivalent to:
> + * -A chaos -m statistic --mode random --probability \
> + * $reject_percentage -j REJECT --reject-with host-unreach;
> + * -A chaos -m statistic --mode random --probability \
> + * $delude_percentage -j DELUDE;
> + * -A chaos -j DROP;
> + */

What does this do that can't be done by simply adding those individual
rules?

> + const struct xt_chaos_info *info = targinfo;
> +
> + if((unsigned int)net_random() <= reject_percentage)
> + return xt_reject->target(pskb, in, out, hooknum, target,
> + &reject_params);
> +
> + /* TARPIT/DELUDE may not be called from the OUTPUT chain */
> + if((*pskb)->nh.iph->protocol == IPPROTO_TCP &&
> + info->variant != XTCHAOS_NORMAL && hooknum != NF_IP_LOCAL_OUT)
> + xt_chaos_total(info, pskb, in, out, hooknum);
> +
> + return NF_DROP;
> +}


> Index: linux-2.6.21-rc3/net/netfilter/xt_DELUDE.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3/net/netfilter/xt_DELUDE.c

Looks like a copy of the REJECT target. What does it do,
why can't you use REJECT?

> Index: linux-2.6.21-rc3/net/netfilter/xt_portscan.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3/net/netfilter/xt_portscan.c

We already have the psd match for years, but decided against merging
it.
-
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/