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

[Xen-changelog] [xen-unstable] [NET] back: Fix bug in 12262:ac2097d71e06dbbf77279af10d6ae7359d921ab0.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ba84d697b1eafe46f357f9498a8e7c823f44c69d
# Parent  b276ed52616aa89b12e6cbb2f8c3e21cddfefb97
[NET] back: Fix bug in 12262:ac2097d71e06dbbf77279af10d6ae7359d921ab0.
Pointed out by Jan Beulich.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netback/netback.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r b276ed52616a -r ba84d697b1ea 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Thu Nov 16 
07:48:37 2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Thu Nov 16 
08:56:58 2006 +0000
@@ -825,7 +825,9 @@ static void tx_add_credit(netif_t *netif
        max_burst = max(max_burst, netif->credit_bytes);
 
        /* Take care that adding a new chunk of credit doesn't wrap to zero. */
-       max_credit = max(netif->remaining_credit + netif->credit_bytes, ~0UL);
+       max_credit = netif->remaining_credit + netif->credit_bytes;
+       if (max_credit < netif->remaining_credit)
+               max_credit = ULONG_MAX; /* wrapped: clamp to ULONG_MAX */
 
        netif->remaining_credit = min(max_credit, max_burst);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.