Re: [PATCH nft 3/4] meta: add probability matching

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

 



On Thursday 2016-03-03 18:56, Florian Westphal wrote:

>The float value has to be in range of 0.0000001 to 0.9999999 and
>+
>+		if (tmp >= UINT_MAX || d > 0.9999999)
>+			return error(loc, "Probability " META_PROB_FMT " too %s", d, "big");

You are misappropriating some 430 points here. 0.9999999 maps to
just 0xfffffe51.

>+		*value = (uint32_t) tmp;
>+		if (*value == 0)
>+			return error(loc, "Probability " META_PROB_FMT " too %s", d, "small");

Though d==0 and d==1 are not overly useful, why prohibit them? iptables 
allowed taking them, and I hear people are working on a translator...*boom*
--
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