[PKT_SCHED] act_gact: division by zero

2006-11-30 Thread Nordlund Kim (Nokia-NET/Helsinki)
tc qdisc add dev eth1 handle : ingress tc filter add dev eth1 protocol ip parent : pref 99 basic \ flowid 1:1 action pass random determ drop 0 ^ the above cause a division by zero in the kernel on the first packet in. Signed-off-by: Kim

Re: [PKT_SCHED] act_gact: division by zero

2006-11-30 Thread Nordlund Kim (Nokia-NET/Helsinki)
On Thu, 30 Nov 2006, ext Patrick McHardy wrote: I think it should reject an invalid configuration or handle the zero case correctly by not dividing. You are correct. Not returning -EINVAL, because someone might want to use the value zero in some future gact_prob algorithm? Signed-off-by: Kim

Re: [PKT_SCHED] cls_basic: Use unsigned int when generating handle

2006-09-27 Thread Nordlund Kim (Nokia-NET/Helsinki)
On Tue, 26 Sep 2006, ext Thomas Graf wrote: You're right, 0x8000 - 1 is already positive. Ignore the patch. basic_change() won't work without this patch if we compile the kernel with the GCC version in RHEL5... gcc version 4.1.1 20060817 (Red Hat 4.1.1-18) which optimizes the code like

Re: [PKT_SCHED] cls_basic: Use unsigned int when generating handle

2006-09-27 Thread Nordlund Kim (Nokia-NET/Helsinki)
On Wed, 27 Sep 2006, ext Thomas Graf wrote: gcc = 4.1 seems to produce this code with either -Os or -O2 so the range of affected useres might in fact be bigger. I believe gcc = 4.1 is just updating to match ISO/IEC 9899:1999: This piece of code crosses undefined behaviour as defined in