summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-02-17 18:29:02 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-02-17 18:29:02 +0000
commitb2d7fd8c8e1c7948169726639675d462bd83e50e (patch)
tree30dec86bd953ffa03cef2a1298c94474990612b4
parent1118351ad3803d4508a146762775a9ee1e05c09c (diff)
Fix sequence increment
-rw-r--r--test/l2test.c6
-rw-r--r--test/rctest.c3
-rw-r--r--test/scotest.c3
3 files changed, 8 insertions, 4 deletions
diff --git a/test/l2test.c b/test/l2test.c
index d02eb3c0..4d782532 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -469,8 +469,9 @@ void send_mode(int s)
seq = 0;
while ((num_frames == -1) || (num_frames-- > 0)) {
- *(uint32_t *) buf = htobl(seq++);
+ *(uint32_t *) buf = htobl(seq);
*(uint16_t *)(buf+4) = htobs(data_size);
+ seq++;
if (send(s, buf, data_size, 0) <= 0) {
syslog(LOG_ERR, "Send failed. %s(%d)", strerror(errno), errno);
@@ -497,8 +498,9 @@ void senddump_mode(int s)
seq = 0;
while ((num_frames == -1) || (num_frames-- > 0)) {
- *(uint32_t *) buf = htobl(seq++);
+ *(uint32_t *) buf = htobl(seq);
*(uint16_t *)(buf+4) = htobs(data_size);
+ seq++;
if (send(s, buf, data_size, 0) <= 0) {
syslog(LOG_ERR, "Send failed. %s(%d)", strerror(errno), errno);
diff --git a/test/rctest.c b/test/rctest.c
index 47039555..3d50ba95 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -279,8 +279,9 @@ void send_mode(int s)
seq = 0;
while ((num_frames == -1) || (num_frames-- > 0)) {
- *(uint32_t *) buf = htobl(seq++);
+ *(uint32_t *) buf = htobl(seq);
*(uint16_t *)(buf+4) = htobs(data_size);
+ seq++;
if (send(s, buf, data_size, 0) <= 0) {
syslog(LOG_ERR, "Send failed. %s(%d)", strerror(errno), errno);
diff --git a/test/scotest.c b/test/scotest.c
index dcb1acdf..0c8d8da3 100644
--- a/test/scotest.c
+++ b/test/scotest.c
@@ -215,8 +215,9 @@ void send_mode(char *svr)
seq = 0;
while (1) {
- *(uint32_t *)buf = htobl(seq++);
+ *(uint32_t *)buf = htobl(seq);
*(uint16_t *)(buf+4) = htobs(data_size);
+ seq++;
if (send(s, buf, so.mtu, 0) <= 0) {
syslog(LOG_ERR, "Send failed. %s(%d)",