From: "cron2 (Code Review)" Date: Wed, 25 Dec 2024 15:31:47 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <90d28e37fdb3368c9bd64906ee0943970edd3ddb-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="aRhGYYFd+m4="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Change internal id of packet id to uint64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: stipa , flichtenheld , openvpn-devel --aRhGYYFd+m4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: stipa. cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/80= 2?usp=3Demail ) Change subject: Change internal id of packet id to uint64 ...................................................................... Change internal id of packet id to uint64 This allows to get rid of multiple casts and also prepares for the larger packet id used by epoch data format. Change-Id: If470af2eb456b2b10f9f2806933e026842188c42 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20241225142131.12543-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 199.html Signed-off-by: Gert Doering --- M src/openvpn/packet_id.c M src/openvpn/packet_id.h M tests/unit_tests/openvpn/test_packet_id.c 3 files changed, 55 insertions(+), 59 deletions(-) diff --git a/src/openvpn/packet_id.c b/src/openvpn/packet_id.c index fb962e4..117c95f 100644 --- a/src/openvpn/packet_id.c +++ b/src/openvpn/packet_id.c @@ -36,6 +36,8 @@ #include "syshead.h" +#include + #include "packet_id.h" #include "misc.h" #include "integer.h" @@ -56,7 +58,7 @@ const struct packet_id_rec *p, const struct packet_id_net *pin, const char *message, - int value); + packet_id_print_type value); #endif /* ENABLE_DEBUG */ @@ -65,7 +67,7 @@ const struct packet_id_rec *p, const struct packet_id_net *pin, const char *message, - int value) + uint64_t value) { #ifdef ENABLE_DEBUG if (unlikely(check_debug_level(msglevel))) @@ -115,22 +117,21 @@ const time_t local_now =3D now; if (p->seq_list) { - packet_id_type diff; + int64_t diff; /* - * If time value increases, start a new - * sequence number sequence. + * If time value increases, start a new sequence number sequence. */ if (!CIRC_LIST_SIZE(p->seq_list) || pin->time > p->time - || (pin->id >=3D (packet_id_type)p->seq_backtrack - && pin->id - (packet_id_type)p->seq_backtrack > p->id)) + || (pin->id >=3D p->seq_backtrack + && pin->id - p->seq_backtrack > p->id)) { p->time =3D pin->time; p->id =3D 0; - if (pin->id > (packet_id_type)p->seq_backtrack) + if (pin->id > p->seq_backtrack) { - p->id =3D pin->id - (packet_id_type)p->seq_backtrack; + p->id =3D pin->id - p->seq_backtrack; } CIRC_LIST_RESET(p->seq_list); } @@ -146,7 +147,7 @@ } diff =3D p->id - pin->id; - if (diff < (packet_id_type) CIRC_LIST_SIZE(p->seq_list) + if (diff < CIRC_LIST_SIZE(p->seq_list) && local_now > SEQ_EXPIRED) { CIRC_LIST_ITEM(p->seq_list, diff) =3D local_now; @@ -170,9 +171,8 @@ const time_t local_now =3D now; if (p->time_backtrack) { - int i; bool expire =3D false; - for (i =3D 0; i < CIRC_LIST_SIZE(p->seq_list); ++i) + for (int i =3D 0; i < CIRC_LIST_SIZE(p->seq_list); ++i) { const time_t t =3D CIRC_LIST_ITEM(p->seq_list, i); if (t =3D=3D SEQ_EXPIRED) @@ -200,7 +200,7 @@ packet_id_test(struct packet_id_rec *p, const struct packet_id_net *pin) { - packet_id_type diff; + uint64_t diff; packet_id_debug(D_PID_DEBUG, p, pin, "PID_TEST", 0); @@ -231,9 +231,9 @@ diff =3D p->id - pin->id; /* keep track of maximum backtrack seen for debugging purposes= */ - if ((int)diff > p->max_backtrack_stat) + if (diff > p->max_backtrack_stat) { - p->max_backtrack_stat =3D (int)diff; + p->max_backtrack_stat =3D diff; packet_id_debug(D_PID_DEBUG_LOW, p, pin, "PID_ERR replay-w= indow backtrack occurred", p->max_backtrack_stat); } @@ -557,7 +557,7 @@ const struct packet_id_rec *p, const struct packet_id_net *pin, const char *message, - int value) + packet_id_print_type value) { struct gc_arena gc =3D gc_new(); struct buffer out =3D alloc_buf_gc(256, &gc); @@ -569,7 +569,7 @@ CLEAR(tv); gettimeofday(&tv, NULL); - buf_printf(&out, "%s [%d]", message, value); + buf_printf(&out, "%s [" packet_id_format "]", message, value); buf_printf(&out, " [%s-%d] [", p->name, p->unit); for (i =3D 0; sl !=3D NULL && i < sl->x_size; ++i) { @@ -604,17 +604,17 @@ } buf_printf(&out, "%c", c); } - buf_printf(&out, "] %" PRIi64 ":" packet_id_format, (int64_t)p->time, = (packet_id_print_type)p->id); + buf_printf(&out, "] %" PRIi64 ":" packet_id_format, (int64_t)p->time, = p->id); if (pin) { - buf_printf(&out, " %" PRIi64 ":" packet_id_format, (int64_t)pin->t= ime, (packet_id_print_type)pin->id); + buf_printf(&out, " %" PRIi64 ":" packet_id_format, (int64_t)pin->t= ime, pin->id); } buf_printf(&out, " t=3D%" PRIi64 "[%d]", (int64_t)prev_now, (int)(prev_now - tv.tv_sec)); - buf_printf(&out, " r=3D[%d,%d,%d,%d,%d]", + buf_printf(&out, " r=3D[%d,%" PRIu64 ",%d,%" PRIu64 ",%d]", (int)(p->last_reap - tv.tv_sec), p->seq_backtrack, p->time_backtrack, diff --git a/src/openvpn/packet_id.h b/src/openvpn/packet_id.h index 3778d19..d8a3e1a 100644 --- a/src/openvpn/packet_id.h +++ b/src/openvpn/packet_id.h @@ -35,11 +35,13 @@ #include "error.h" #include "otime.h" -#if 1 /* - * These are the types that members of - * a struct packet_id_net are converted - * to for network transmission. + * These are the types that members of a struct packet_id_net are converted + * to for network transmission and for saving to a persistent file. + * + * Note: data epoch data uses a 64 bit packet ID + * compromised of 16 bit epoch and 48 bit per-epoch packet counter. + * These are ephemeral and are never saved to a file. */ typedef uint32_t packet_id_type; #define PACKET_ID_MAX UINT32_MAX @@ -64,31 +66,12 @@ /* convert a net_time_t in network order to a time_t in host order */ #define ntohtime(x) ((time_t)ntohl(x)) -#else /* if 1 */ - -/* - * DEBUGGING ONLY. - * Make packet_id_type and net_time_t small - * to test wraparound logic and corner cases. - */ - -typedef uint8_t packet_id_type; -typedef uint16_t net_time_t; - -#define PACKET_ID_WRAP_TRIGGER 0x80 - -#define htonpid(x) (x) -#define ntohpid(x) (x) -#define htontime(x) htons((net_time_t)x) -#define ntohtime(x) ((time_t)ntohs(x)) - -#endif /* if 1 */ /* * Printf formats for special types */ -#define packet_id_format "%u" -typedef unsigned int packet_id_print_type; +#define packet_id_format "%" PRIu64 +typedef uint64_t packet_id_print_type; /* * Maximum allowed backtrack in @@ -128,10 +111,10 @@ { time_t last_reap; /* last call of packet_id_reap */ time_t time; /* highest time stamp received */ - packet_id_type id; /* highest sequence number received */ - int seq_backtrack; /* set from --replay-window */ + uint64_t id; /* highest sequence number received */ + uint64_t seq_backtrack; /* set from --replay-window */ int time_backtrack; /* set from --replay-window */ - int max_backtrack_stat; /* maximum backtrack seen so far */ + uint64_t max_backtrack_stat; /* maximum backtrack seen so far */ bool initialized; /* true if packet_id_init was called */ struct seq_list *seq_list; /* packet-id "memory" */ const char *name; @@ -164,7 +147,7 @@ */ struct packet_id_send { - packet_id_type id; + uint64_t id; time_t time; }; @@ -174,8 +157,12 @@ * sequence number. A long packet-id * includes a timestamp as well. * + * An epoch packet-id is a 16 bit epoch + * counter plus a 48 per-epoch packet-id + * * Long packet-ids are used as IVs for - * CFB/OFB ciphers. + * CFB/OFB ciphers and for control channel + * messages. * * This data structure is always sent * over the net in network byte order, @@ -191,9 +178,16 @@ * 64 bit platforms use a * 64 bit time_t. */ + +/** + * Data structure for describing the packet id that is received/send to the + * network. This struct does not match the on wire format. + */ struct packet_id_net { - packet_id_type id; + /* converted to packet_id_type on non-epoch data ids, does not contain + * the epoch but is a flat id */ + uint64_t id; time_t time; /* converted to net_time_t before transmission */ }; diff --git a/tests/unit_tests/openvpn/test_packet_id.c b/tests/unit_tests/o= penvpn/test_packet_id.c index a3567bc..d918985 100644 --- a/tests/unit_tests/openvpn/test_packet_id.c +++ b/tests/unit_tests/openvpn/test_packet_id.c @@ -90,8 +90,8 @@ now =3D 5010; assert_true(packet_id_write(&data->pis, &data->test_buf, true, false)); - assert(data->pis.id =3D=3D 1); - assert(data->pis.time =3D=3D now); + assert_int_equal(data->pis.id, 1); + assert_int_equal(data->pis.time, now); assert_true(data->test_buf_data.buf_id =3D=3D htonl(1)); assert_true(data->test_buf_data.buf_time =3D=3D htonl((uint32_t)now)); } @@ -117,8 +117,8 @@ data->test_buf.offset =3D sizeof(data->test_buf_data); now =3D 5010; assert_true(packet_id_write(&data->pis, &data->test_buf, true, true)); - assert(data->pis.id =3D=3D 1); - assert(data->pis.time =3D=3D now); + assert_int_equal(data->pis.id, 1); + assert_int_equal(data->pis.time, now); assert_true(data->test_buf_data.buf_id =3D=3D htonl(1)); assert_true(data->test_buf_data.buf_time =3D=3D htonl((uint32_t)now)); } @@ -128,7 +128,8 @@ { struct test_packet_id_write_data *data =3D *state; - data->pis.id =3D ~0; + /* maximum 32-bit packet id */ + data->pis.id =3D (packet_id_type)(~0); assert_false(packet_id_write(&data->pis, &data->test_buf, false, false= )); } =20 @@ -137,7 +138,8 @@ { struct test_packet_id_write_data *data =3D *state; - data->pis.id =3D ~0; + /* maximum 32-bit packet id */ + data->pis.id =3D (packet_id_type)(~0); data->pis.time =3D 5006; =20 /* Write fails if time did not change */ @@ -148,8 +150,8 @@ now =3D 5010; assert_true(packet_id_write(&data->pis, &data->test_buf, true, false)); - assert(data->pis.id =3D=3D 1); - assert(data->pis.time =3D=3D now); + assert_int_equal(data->pis.id, 1); + assert_int_equal(data->pis.time, now); assert_true(data->test_buf_data.buf_id =3D=3D htonl(1)); assert_true(data->test_buf_data.buf_time =3D=3D htonl((uint32_t)now)); } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/802?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If470af2eb456b2b10f9f2806933e026842188c42 Gerrit-Change-Number: 802 Gerrit-PatchSet: 9 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-Attention: stipa Gerrit-MessageType: merged --aRhGYYFd+m4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: stipa.

cron2 submitted this change.

View Change

Change internal id of packet id to uint64
<= br>This allows to get rid of multiple casts and also prepares for the
la= rger packet id used by epoch data format.

Change-Id: If470af2eb456b2= b10f9f2806933e026842188c42
Signed-off-by: Arne Schwabe <arne@...2639...= ..>
Acked-by: Gert Doering <gert@...1296...>
Message-Id: <= ;20241225142131.12543-1-gert@...1296...>
URL: https://www.mail-archiv= e.com/openvpn-devel@lists.sourceforge.net/msg30199.html
Signed-off-by: G= ert Doering <gert@...1296...>
---
M src/openvpn/packet_id.c
= M src/openvpn/packet_id.h
M tests/unit_tests/openvpn/test_packet_id.c3 files changed, 55 insertions(+), 59 deletions(-)

diff --git a/src/openvpn/packet_id.c b/src/openvpn/packet_id.cindex fb962e4..117c95f 100644
--- a/src/openvpn/pack= et_id.c
+++ b/src/openvpn/packet_id.c
@@ -3= 6,6 +36,8 @@

#include "syshead.h&qu= ot;

+#include <stddef.h>
+
#include "packet_id.h"
= #include "misc.h"
#include "integer.h"= ;
@@ -56,7 +58,7 @@
= const struct packet_id_rec *p,
= const struct packet_id_net *pin,
= const char *message,
- int value);
+ = packet_id_print_type value);

= #endif /* ENABLE_DEBUG */

@@ -65,7 +67,7= @@
const struct packet_id_rec *p,<= br> const struct packet_id_net *pin,
= const char *message,
- int value)
+ uint64_t value)
{
#ifdef ENABLE_DEBUG
if (unlikely(check= _debug_level(msglevel)))
@@ -115,22 +117,21 @@
const time_t local_now =3D now;

if (p->seq= _list)
{
- packet_id_type diff;
+ int64_t diff;

= /*
- * I= f time value increases, start a new
- * sequence number sequence.
+ * If time value increases, start a = new sequence number sequence.
*/
= if (!CIRC_LIST_SIZE(p->seq_list)
|= | pin->time > p->time
- || (pin->id >=3D (packet_id_type)p->seq_backt= rack
- &= amp;& pin->id - (packet_id_type)p->seq_backtrack > p->id))<= /span>
+ || (pin-= >id >=3D p->seq_backtrack
+ && pin->id - p->seq_backtrack = > p->id))
{
p-&= gt;time =3D pin->time;
p->id =3D 0;
- if (pin->id= > (packet_id_type)p->seq_backtrack)
+ if (pin->id > p->seq_backtrack)=
{
- p->id =3D pin->id - (packet_id_type)p->s= eq_backtrack;
+ = p->id =3D pin->id - p->seq_backtrack;
= }
CIRC_LIST_RESET(p->seq_list);<= /span>
}
@@ -146,7 +147,7 @@
}


diff =3D p->id= - pin->id;
- = if (diff < (packet_id_type) CIRC_LIST_SIZE(p->seq_list)
+ if (diff < CIRC_LIST_= SIZE(p->seq_list)

&& local_now >= SEQ_EXPIRED)
{
CIRC_= LIST_ITEM(p->seq_list, diff) =3D local_now;
@@ -170,9 +1= 71,8 @@
const time_t local_now =3D now;
if (p->time_backtrack)

{
- int i;
b= ool expire =3D false;
-= for (i =3D 0; i < CIRC_LIST_SIZE(p->seq_list); ++i)+ for (int i =3D 0; i &= lt; CIRC_LIST_SIZE(p->seq_list); ++i)
{<= br> const time_t t =3D CIRC_LIST_ITEM(p->seq_list, i);=
if (t =3D=3D SEQ_EXPIRED)
@@ = -200,7 +200,7 @@
packet_id_test(struct packet_id_rec *p,
const struct packet_id_net *pin)
<= span> {

- packet_id_= type diff;
+ uint6= 4_t diff;

packet_id_debug(D_PID_DEBU= G, p, pin, "PID_TEST", 0);

@@ -= 231,9 +231,9 @@
diff =3D p->id - pin->id= ;

/* keep track of maximum b= acktrack seen for debugging purposes */
- if ((int)diff > p->max_backtrack_stat)<= /span>
+ if (diff= > p->max_backtrack_stat)
{
- p->max_backtrac= k_stat =3D (int)diff;

+ p->max_backtrack_stat =3D diff;
= packet_id_debug(D_PID_DEBUG_LOW, p, pin, "PID_ERR replay-wi= ndow backtrack occurred", p->max_backtrack_stat);
= }

@@ -557,7 +557,7 @@<= br> const struct packet_id_rec *p,
const struct packet_id_net *pin,

const char *message,
- int value)
+ packet_id_print_t= ype value)
{
struct gc_arena gc =3D g= c_new();
struct buffer out =3D alloc_buf_gc(256, &= gc);
@@ -569,7 +569,7 @@
CLEAR(tv);
gettimeofday(&tv, NULL);
- buf_printf(&out, "= %s [%d]", message, value);
+ buf_printf(&out, "%s [" packet_id_format &quo= t;]", message, value);
buf_printf(&out, "= ; [%s-%d] [", p->name, p->unit);
for (i =3D= 0; sl !=3D NULL && i < sl->x_size; ++i)
= {
@@ -604,17 +604,17 @@
}<= br> buf_printf(&out, "%c", c);
= }
- buf_printf(= &out, "] %" PRIi64 ":" packet_id_format, (int64_t)p= ->time, (packet_id_print_type)p->id);
+ buf_printf(&out, "] %" PRIi64 &qu= ot;:" packet_id_format, (int64_t)p->time, p->id);
if (pin)

{
- buf_printf(&out, " %" PRIi64 ":= " packet_id_format, (int64_t)pin->time, (packet_id_print_type)pin-&= gt;id);
+ buf_= printf(&out, " %" PRIi64 ":" packet_id_format, (int= 64_t)pin->time, pin->id);
}

buf_printf(&out, " t=3D%" PRIi64 "[%d= ]",
(int64_t)prev_now,
(int)(prev_now - tv.tv_sec));


= - buf_printf(&out, " = r=3D[%d,%d,%d,%d,%d]",
+ buf_printf(&out, " r=3D[%d,%" PRIu64 ",%d,%&= quot; PRIu64 ",%d]",
(int)(p->= last_reap - tv.tv_sec),
p->seq_backtrack= ,
p->time_backtrack,
dif= f --git a/src/openvpn/packet_id.h b/src/openvpn/packet_id.h
index 3778d19..d8a3e1a 100644
--- a/src/openvpn/packet_id.= h
+++ b/src/openvpn/packet_id.h
@@ -35,11 += 35,13 @@
#include "error.h"
#in= clude "otime.h"

-#if 1
/*
- * These are the types that members of
= - * a struct packet_id_net are co= nverted
- * to for netw= ork transmission.
+ *= These are the types that members of a struct packet_id_net are converted
+ * to for network tra= nsmission and for saving to a persistent file.
+ *
+ * Note: data epoch data uses a 64 bit packet ID
+ * compromised of 16 bit epoch and 4= 8 bit per-epoch packet counter.
+ * These are ephemeral and are never saved to a file. */
typedef uint32_t packet_id_type;
#define PACKET_ID_MAX UINT32_MAX

@@ -64,31 +66,12 @@
/* convert a net_time_t in network order to a time_t in host= order */
#define ntohtime(x) ((time_t)ntohl(x))
-#else /* if = 1 */
-
-/*
- * DEBUGGING ONLY.
- * Make packet_id_type and net_time_t small
- * to test wraparound logic and corner= cases.
- */
= -
-typedef uint8_t packet_id_type;
-typedef uint16_t net_time_t;
-

-#define PACKET_ID_WRAP_TRIGGER 0x80
-
-#define htonpid(x) (x)
-#define ntohpid(x) (x)
-#define htontime(x) htons((net_time_t)x)
-#define ntohtime(x) ((time_t)ntohs(x))
-
-#endif /* if 1 */

<= span> /*

* Printf formats for special types
*/
-#define packet= _id_format "%u"
-typedef unsigned int packet_id_print_type;
+#define packet_id_format "%" PRIu64
+typedef uint64_t packe= t_id_print_type;

/*
* = Maximum allowed backtrack in
@@ -128,10 +111,10 @@ {
time_t last_reap; /* last call of p= acket_id_reap */
time_t time; /* highest = time stamp received */
= - packet_id_type id; /* highest sequence number received */

- int seq_backtrack; = /* set from --replay-window */
+ uint64_t id; /* highest sequence number rece= ived */
+ uint64_t= seq_backtrack; /* set from --replay-window */
int t= ime_backtrack; /* set from --replay-window */
- int max_backtrack_stat; /* maximum ba= cktrack seen so far */
= - packet_id_type id;
+ uint64_t id;
time_t time;
};<= /span>

@@ -174,8 +157,12 @@
* = sequence number. A long packet-id
* includes a timestamp= as well.
*
+ * An epoch packet-id is a 16 bit epoch
+ * counter plus a 48 per-epoch packet-id
+ *
* L= ong packet-ids are used as IVs for
- * CFB/OFB ciphers.
+ * CFB/OFB ciphers and for control channel
+ * messages.
*=
* This data structure is always sent
* over t= he net in network byte order,
@@ -191,9 +178,16 @@ * 64 bit platforms use a
* 64 bit time_t.

*/
+

+/**
+ * Data structure for describing the pa= cket id that is received/send to the
+ * network. This struct does not match the on wire format.=
+ */
struct packet_id_net
{
- packet_id_type id;
+ /* converted to packet_id_type on non-epoch data= ids, does not contain
+ uint64_t id;
time_t time; /* c= onverted to net_time_t before transmission */
};
diff --git a/tests/unit_tests/openvpn/test_packet_= id.c b/tests/unit_tests/openvpn/test_packet_id.c
index a356= 7bc..d918985 100644
--- a/tests/unit_tests/openvpn/test_pac= ket_id.c
+++ b/tests/unit_tests/openvpn/test_packet_id.c
@@ -90,8 +90,8 @@

now = =3D 5010;
assert_true(packet_id_write(&data->pi= s, &data->test_buf, true, false));
- assert(data->pis.id =3D=3D 1);
- assert(data->pis.time =3D=3D now= );
+ assert_int_eq= ual(data->pis.id, 1);
+ assert_int_equal(data->pis.time, now);
ass= ert_true(data->test_buf_data.buf_id =3D=3D htonl(1));
= assert_true(data->test_buf_data.buf_time =3D=3D htonl((uint32_t)now))= ;
}
@@ -117,8 +117,8 @@
= data->test_buf.offset =3D sizeof(data->test_buf_data);
<= span> now =3D 5010;

assert_true(packet_id_write(&a= mp;data->pis, &data->test_buf, true, true));
- assert(data->pis.id =3D=3D 1);
- assert(data->pis.ti= me =3D=3D now);
+ = assert_int_equal(data->pis.id, 1);
+ assert_int_equal(data->pis.time, now);
<= span> assert_true(data->test_buf_data.buf_id =3D=3D htonl(1));

assert_true(data->test_buf_data.buf_time =3D=3D htonl((u= int32_t)now));
}
@@ -128,7 +128,8 @@
{
struct test_packet_id_write_data *data = =3D *state;

- data->pis.id =3D ~0;
+ /* maximum 32-bit packet id */
+ data->pis.id =3D (packet_id_type)(~0)= ;
assert_false(packet_id_write(&data->pis, &= ;data->test_buf, false, false));
}

@@ -137,7 +138,8 @@
{
s= truct test_packet_id_write_data *data =3D *state;
<= br>- data->pis.id =3D ~0;
+ /* maximum 32-bit= packet id */
+ da= ta->pis.id =3D (packet_id_type)(~0);
data->pis.t= ime =3D 5006;

/* Write fails if time= did not change */
@@ -148,8 +150,8 @@
= now =3D 5010;
assert_true(packet_id_write(&data-&= gt;pis, &data->test_buf, true, false));

= - assert(data->pis.id =3D= =3D 1);
- assert(dat= a->pis.time =3D=3D now);
+ assert_int_equal(data->pis.id, 1);
+ assert_int_equal(data->pis.time, now);=
assert_true(data->test_buf_data.buf_id =3D=3D hton= l(1));
assert_true(data->test_buf_data.buf_time =3D= =3D htonl((uint32_t)now));
}

To view, visit change 802. To unsubscribe, or for help writing mail filte= rs, visit settings.

<= div itemscope itemtype=3D"http://schema.org/EmailMessage">
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If470af2eb456b2b10f9f2806933= e026842188c42
Gerrit-Change-Number: 802
Gerrit-PatchSet: 9
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-MessageType: merged
--aRhGYYFd+m4=--