Skip to contentSkip to conversation

: 48-bit sequence number arithmetic

PATCH New Gerrit Renker 1 participant 1 message Mar 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 10/31 : 48-bit sequence number arithmetic

This patch
* organizes the sequence arithmetic functions into one corner of dccp.h
* performs a small modification of dccp_set_seqno to make it more widely reusable (now it is safe to use any number, since it performs modulo-2^48 assignment)
* adds functions and generic macros for 48-bit sequence arithmetic:
--48 bit complement
--modulo-48 addition and modulo-48 subtraction --dccp_inc_seqno now a special case of add48
Constants renamed following a suggestion by Arnaldo.

---
 net/dccp/ackvec.c |    2 +-
 net/dccp/dccp.h   |   47 +++++++++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 21 deletions(-)
net/dccp/ackvec.c +1 -1
index a086c63..01030f3 100644
@@ -157,7 +157,7 @@ struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority)
 
 	if (av != NULL) {
 		av->dccpav_buf_head	= DCCP_MAX_ACKVEC_LEN - 1;
-		av->dccpav_buf_ackno	= DCCP_MAX_SEQNO + 1;
+		av->dccpav_buf_ackno	= UINT48_MAX + 1;
 		av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0;
 		av->dccpav_time.tv_sec	= 0;
 		av->dccpav_time.tv_usec	= 0;
net/dccp/dccp.h +27 -20

59 lines not on this page · raw message

Signature · 1 line
1.5.0.3