[NET] back: Fix bug in 12262:ac2097d71e06dbbf77279af10d6ae7359d921ab0.

Pointed out by Jan Beulich.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-11-16 08:56:58 +00:00
1 parent f8e7741960
commit 3e7ce38dce
1 file changed
+3 -1
@@ -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);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.