* Re: net-2.6.17 rebased...
@ 2006-03-02 0:28 Ian McDonald
2006-03-02 0:32 ` Ian McDonald
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ian McDonald @ 2006-03-02 0:28 UTC (permalink / raw)
To: dccp
On 3/2/06, David S. Miller <davem@davemloft.net> wrote:
>
> This tree was getting crufty, so I rebased it today.
> It was actually a lot easier than I had anticipated.
>
> master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.17.git
>
Dave,
If you get a chance can you push the ccid3 divide by zero fix upstream
to Linus for 2.6.16 as it has no functionality changed and eliminates
a nasty little bug...
The commit for this is b6da19617f4ab610d3d90bcbdf65fa7e2b3d7b53 in your tree
I have also put at end of this e-mail after reapplying on linus tree
so above commit doesn't have fuzz...
[DCCP] ccid3: Divide by zero fix
In rare circumstances 0 is returned by dccp_li_hist_calc_i_mean which leads to
a divide by zero in ccid3_hc_rx_packet_recv. Explicitly check for zero return
now. Update copyright notice at same time.
Found by Arnaldo.
Signed-off-by: Ian McDonald <imcdnzl@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
--- 2b82f96f1291c42ee9485465801f5f51897bec64
+++ ff426a9009993445a15cfcac6c88be1e39e07913
@@ -2,7 +2,7 @@
* net/dccp/ccids/ccid3.c
*
* Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
- * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
+ * Copyright (c) 2005-6 Ian McDonald <imcdnzl@gmail.com>
*
* An implementation of the DCCP protocol
*
@@ -1014,9 +1014,13 @@ static void ccid3_hc_rx_packet_recv(stru
p_prev = hcrx->ccid3hcrx_p;
/* Calculate loss event rate */
- if (!list_empty(&hcrx->ccid3hcrx_li_hist))
+ if (!list_empty(&hcrx->ccid3hcrx_li_hist)) {
+ u32 i_mean = dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+
/* Scaling up by 1000000 as fixed decimal */
- hcrx->ccid3hcrx_p = 1000000 /
dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+ if (i_mean != 0)
+ hcrx->ccid3hcrx_p = 1000000 / i_mean;
+ }
if (hcrx->ccid3hcrx_p > p_prev) {
ccid3_hc_rx_send_feedback(sk);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: net-2.6.17 rebased...
2006-03-02 0:28 net-2.6.17 rebased Ian McDonald
@ 2006-03-02 0:32 ` Ian McDonald
2006-03-02 0:48 ` Ian McDonald
2006-03-04 1:55 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: Ian McDonald @ 2006-03-02 0:32 UTC (permalink / raw)
To: dccp
F**k - just pasted in the wrong file. Trying again
On 3/2/06, Ian McDonald <imcdnzl@gmail.com> wrote:
> On 3/2/06, David S. Miller <davem@davemloft.net> wrote:
> >
> > This tree was getting crufty, so I rebased it today.
> > It was actually a lot easier than I had anticipated.
> >
> > master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.17.git
> >
> Dave,
>
> If you get a chance can you push the ccid3 divide by zero fix upstream
> to Linus for 2.6.16 as it has no functionality changed and eliminates
> a nasty little bug...
>
> The commit for this is b6da19617f4ab610d3d90bcbdf65fa7e2b3d7b53 in your tree
>
I have also put at end of this e-mail after reapplying on linus tree
so above commit doesn't have fuzz...
[DCCP] ccid3: Divide by zero fix
In rare circumstances 0 is returned by dccp_li_hist_calc_i_mean which leads to
a divide by zero in ccid3_hc_rx_packet_recv. Explicitly check for zero return
now. Update copyright notice at same time.
Found by Arnaldo.
Signed-off-by: Ian McDonald <imcdnzl@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index aa68e0a..35d1d34 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -2,7 +2,7 @@
* net/dccp/ccids/ccid3.c
*
* Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
- * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
+ * Copyright (c) 2005-6 Ian McDonald <imcdnzl@gmail.com>
*
* An implementation of the DCCP protocol
*
@@ -1033,9 +1033,13 @@ static void ccid3_hc_rx_packet_recv(stru
p_prev = hcrx->ccid3hcrx_p;
/* Calculate loss event rate */
- if (!list_empty(&hcrx->ccid3hcrx_li_hist))
+ if (!list_empty(&hcrx->ccid3hcrx_li_hist)) {
+ u32 i_mean = dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+
/* Scaling up by 1000000 as fixed decimal */
- hcrx->ccid3hcrx_p = 1000000 /
dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+ if (i_mean != 0)
+ hcrx->ccid3hcrx_p = 1000000 / i_mean;
+ }
if (hcrx->ccid3hcrx_p > p_prev) {
ccid3_hc_rx_send_feedback(sk);
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: net-2.6.17 rebased...
2006-03-02 0:28 net-2.6.17 rebased Ian McDonald
2006-03-02 0:32 ` Ian McDonald
@ 2006-03-02 0:48 ` Ian McDonald
2006-03-04 1:55 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: Ian McDonald @ 2006-03-02 0:48 UTC (permalink / raw)
To: dccp
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
And *** again... someone pointed out my mailer is wrapping lines. I'll
go hide in the corner and beat myself up. This time attached as I
can't get gmail to defeat line wrapping. I promise I'll get it right
next patch so I don't humiliate myself quite so much next time
Dave,
If you get a chance can you push the ccid3 divide by zero fix upstream
to Linus for 2.6.16 as it has no functionality changed and eliminates
a nasty little bug...
The commit for this is b6da19617f4ab610d3d90bcbdf65fa7e2b3d7b53 in your tree
I have also put at end of this e-mail after reapplying on linus tree
so above commit doesn't have fuzz...
[DCCP] ccid3: Divide by zero fix
In rare circumstances 0 is returned by dccp_li_hist_calc_i_mean which leads to
a divide by zero in ccid3_hc_rx_packet_recv. Explicitly check for zero return
now. Update copyright notice at same time.
Found by Arnaldo.
Signed-off-by: Ian McDonald <imcdnzl@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: div.diff --]
[-- Type: text/x-patch; name="div.diff", Size: 1007 bytes --]
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index aa68e0a..35d1d34 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -2,7 +2,7 @@
* net/dccp/ccids/ccid3.c
*
* Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
- * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
+ * Copyright (c) 2005-6 Ian McDonald <imcdnzl@gmail.com>
*
* An implementation of the DCCP protocol
*
@@ -1033,9 +1033,13 @@ static void ccid3_hc_rx_packet_recv(stru
p_prev = hcrx->ccid3hcrx_p;
/* Calculate loss event rate */
- if (!list_empty(&hcrx->ccid3hcrx_li_hist))
+ if (!list_empty(&hcrx->ccid3hcrx_li_hist)) {
+ u32 i_mean = dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+
/* Scaling up by 1000000 as fixed decimal */
- hcrx->ccid3hcrx_p = 1000000 / dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+ if (i_mean != 0)
+ hcrx->ccid3hcrx_p = 1000000 / i_mean;
+ }
if (hcrx->ccid3hcrx_p > p_prev) {
ccid3_hc_rx_send_feedback(sk);
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: net-2.6.17 rebased...
2006-03-02 0:28 net-2.6.17 rebased Ian McDonald
2006-03-02 0:32 ` Ian McDonald
2006-03-02 0:48 ` Ian McDonald
@ 2006-03-04 1:55 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2006-03-04 1:55 UTC (permalink / raw)
To: dccp
From: "Ian McDonald" <imcdnzl@gmail.com>
Date: Thu, 2 Mar 2006 13:48:18 +1300
> If you get a chance can you push the ccid3 divide by zero fix upstream
> to Linus for 2.6.16 as it has no functionality changed and eliminates
> a nasty little bug...
> The commit for this is b6da19617f4ab610d3d90bcbdf65fa7e2b3d7b53 in your tree
Done, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-04 1:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02 0:28 net-2.6.17 rebased Ian McDonald
2006-03-02 0:32 ` Ian McDonald
2006-03-02 0:48 ` Ian McDonald
2006-03-04 1:55 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox