Skip to contentSkip to conversation

fuzzy.patch and fuzzy.patch.ipv6 - again.

DISCUSSION Hime Junior 2 participants 2 messages Jun 6, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Harald !

Have you applied that patch ?

As I said before , the new behavior is , in practice , equivalent to the old one.

Regards.

----- Original Message -----
From: "Wojciech \"Sas\" Cieciwa" <[email protected]>
Date: Fri, 6 Jun 2003 15:31:42 +0200 (CEST)
To: Harald Welte <[email protected]>
Subject: fuzzy.patch and fuzzy.patch.ipv6 - again.

Quoted 74 lines

Hi,

I try to build p-o-m [2003 06 05] on PPC and I take some unresolved symbols. I don't know, that I send patch which resole this problem.

If yes, please appaly this.
If not here is the patch.

diff -Nur netfilter.org/patch-o-matic/base/fuzzy.patch netfilter/patch-o-matic/base/fuzzy.patch

patch-o-matic/base/fuzzy.patch +3 -3
@@ -59,7 +59,7 @@
 + Expressed in percentage
 +*/
 +
-+#define PAR_LOW		0.01
++#define PAR_LOW		1/100
 +#define PAR_HIGH	1
 +
 +static spinlock_t fuzzy_lock = SPIN_LOCK_UNLOCKED ;
@@ -138,7 +138,7 @@
 +       howlow  = mf_low(info->mean_rate,info->minimum_rate,info->maximum_rate);
 +
 +    info->acceptance_rate = (u_int8_t) \
-+		           ( PAR_LOW*howhigh + PAR_HIGH*howlow ) ;
++		           ( howhigh*PAR_LOW + PAR_HIGH*howlow ) ;
 +
 +    /* In fact , the above defuzzification would require a denominator
 +       proportional to (howhigh+howlow) but , in this particular case ,
@@ -158,7 +158,7 @@
 +		get_random_bytes((void *)(&random_number), 1);
 +
 +		/*  If within the acceptance , it can pass => don't match */
-+		if ( random_number <= 2.55 * info->acceptance_rate )
++		if ( random_number <= (255 * info->acceptance_rate) / 100 )
 +			return 0 ;
 +		else
 +			return 1; /* It can't pass ( It matches ) */

diff -Nur netfilter.org/patch-o-matic/base/fuzzy6.patch.ipv6 netfilter/patch-o-matic/base/fuzzy6.patch.ipv6

patch-o-matic/base/fuzzy6.patch.ipv6 +3 -3
@@ -60,7 +60,7 @@
 + Expressed in percentage
 +*/
 +
-+#define PAR_LOW		0.01
++#define PAR_LOW		1/100
 +#define PAR_HIGH	1
 +
 +static spinlock_t fuzzy_lock = SPIN_LOCK_UNLOCKED;
@@ -138,7 +138,7 @@
 +		howlow  = mf_low(info->mean_rate,info->minimum_rate,info->maximum_rate);
 +
 +		info->acceptance_rate = (u_int8_t) \
-+				(PAR_LOW * howhigh + PAR_HIGH * howlow);
++				(howhigh * PAR_LOW + PAR_HIGH * howlow);
 +
 +	/* In fact, the above defuzzification would require a denominator
 +	 * proportional to (howhigh+howlow) but, in this particular case,
@@ -158,7 +158,7 @@
 +		get_random_bytes((void *)(&random_number), 1);
 +
 +		/*  If within the acceptance , it can pass => don't match */
-+		if (random_number <= 2.55 * info->acceptance_rate)
++		if (random_number <= (255 * info->acceptance_rate) / 100)
 +			return 0;
 +		else
 +			return 1; /* It can't pass (It matches) */
Signature · 3 lines
-- 
{Wojciech 'Sas' Cieciwa}  {Member of PLD Team                               }
{e-mail: [email protected], http://www2.zarz.agh.edu.pl/~cieciwa}

Hime Junior
___________________________

Electronic and Control Engineer

Signature · 3 lines
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup