All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "Nordlund Kim (Nokia-NET/Helsinki)" <Kim.Nordlund@nokia.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PKT_SCHED] act_gact: division by zero
Date: Thu, 30 Nov 2006 13:17:09 +0100	[thread overview]
Message-ID: <456ECBC5.3080501@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0611301309550.14993-100000@dhcp09282.ntc.nokia.com>

Nordlund Kim (Nokia-NET/Helsinki) wrote:
> tc qdisc add dev eth1 handle ffff: ingress
> tc filter add dev eth1 protocol ip parent ffff: 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 Nordlund <kim.nordlund@nokia.com>
> 
> diff -rub linux-2.6.19-orig/net/sched/act_gact.c linux/net/sched/act_gact.c
> --- linux-2.6.19-orig/net/sched/act_gact.c	2006-11-29 23:57:37.000000000 +0200
> +++ linux/net/sched/act_gact.c	2006-11-30 13:22:37.000000000 +0200
> @@ -111,7 +111,7 @@
>  	if (tb[TCA_GACT_PROB-1] != NULL) {
>  		struct tc_gact_p *p_parm = RTA_DATA(tb[TCA_GACT_PROB-1]);
>  		gact->tcfg_paction = p_parm->paction;
> -		gact->tcfg_pval    = p_parm->pval;
> +		gact->tcfg_pval    = p_parm->pval ? : 1;


I think it should reject an invalid configuration or handle
the zero case correctly by not dividing.

  reply	other threads:[~2006-11-30 12:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-30 12:06 [PKT_SCHED] act_gact: division by zero Nordlund Kim (Nokia-NET/Helsinki)
2006-11-30 12:17 ` Patrick McHardy [this message]
2006-11-30 13:51   ` Nordlund Kim (Nokia-NET/Helsinki)
2006-11-30 14:05     ` Patrick McHardy
2006-12-02  4:21     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456ECBC5.3080501@trash.net \
    --to=kaber@trash.net \
    --cc=Kim.Nordlund@nokia.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.