From: Nickolai Zeldovich Date: Sat, 29 Dec 2001 23:14:24 +0000 (+0000) Subject: STABLE12-rx-compute-ackdatasize-correctly-20011229 X-Git-Tag: openafs-stable-1_2_3~56 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=246a0ef8fa0dc114a650a72500523c9955eae144;p=packages%2Fo%2Fopenafs.git STABLE12-rx-compute-ackdatasize-correctly-20011229 This patch clarifies the implicit 3 reserved bytes in rx_AckDataSize, and hopefully makes the code more portable for future platforms. --- diff --git a/src/rx/rx.h b/src/rx/rx.h index d05cae904..a8d27bbf6 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -735,7 +735,7 @@ struct rx_ackPacket { #define RX_ACK_TYPE_ACK 1 /* I have this packet, although I may discard it later */ /* The packet size transmitted for an acknowledge is adjusted to reflect the actual size of the acks array. This macro defines the size */ -#define rx_AckDataSize(nAcks) (sizeof(struct rx_ackPacket) - RX_MAXACKS + (nAcks)) +#define rx_AckDataSize(nAcks) (3 + offsetof(struct rx_ackPacket, acks[nAcks])) #define RX_CHALLENGE_TIMEOUT 2 /* Number of seconds before another authentication request packet is generated */