DCCP protocol discussions
 help / color / mirror / Atom feed
* [PATCH 10/29] Shorten statement for updating p
@ 2007-04-12 21:15 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: Arnaldo Carvalho de Melo @ 2007-04-12 21:15 UTC (permalink / raw)
  To: dccp

This shortens the statement for updating the loss event
rate p when a feedback packet is received.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
---
 net/dccp/ccids/ccid3.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 22ba3f9..c3711e1 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -466,12 +466,9 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
 	hctx->ccid3hctx_x_recv = opt_recv->ccid3or_receive_rate;
 	hctx->ccid3hctx_x_recv <<= 6;
 
-	/* Update loss event rate */
+	/* Update loss event rate (scaled by 1e6), cf. RFC 4342, 8.5 */
 	pinv = opt_recv->ccid3or_loss_event_rate;
-	if (pinv = ~0U || pinv = 0)	       /* see RFC 4342, 8.5   */
-		hctx->ccid3hctx_p = 0;
-	else				       /* can not exceed 100% */
-		hctx->ccid3hctx_p = 1000000 / pinv;
+	hctx->ccid3hctx_p = (pinv = ~0U || pinv = 0) ? 0 : scaled_div(1, pinv);
 
 	/*
 	 * Calculate new round trip sample as per [RFC 3448, 4.3] by
-- 
1.5.0.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-12 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12 21:15 [PATCH 10/29] Shorten statement for updating p Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox