summaryrefslogtreecommitdiff
path: root/cesar/lib/test/seq_check
diff options
context:
space:
mode:
authorYacine Belkadi2012-06-08 17:08:48 +0200
committerYacine Belkadi2012-09-07 15:21:56 +0200
commit83d2f00da8a89c8c0e1a1b36689b70f1468c7ca9 (patch)
tree49fbbbb05a68644953fab246b029881a7b99d64f /cesar/lib/test/seq_check
parente749ab69bd0338e618a863bade3a5a93d32e9e2b (diff)
cesar/lib/seq_check: auto-adjust seq num position for VLAN packets, refs #3138
Diffstat (limited to 'cesar/lib/test/seq_check')
-rw-r--r--cesar/lib/test/seq_check/src/seq_check.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cesar/lib/test/seq_check/src/seq_check.c b/cesar/lib/test/seq_check/src/seq_check.c
index a7d128ffba..8ad1ddd643 100644
--- a/cesar/lib/test/seq_check/src/seq_check.c
+++ b/cesar/lib/test/seq_check/src/seq_check.c
@@ -162,7 +162,8 @@ test_seq_check_packet (test_t t, lib_rnd_t *rnd, uint pos, u16 ethertype)
16);
test_seq_check_callback_values.cb_called = false;
- bitstream_direct_write (p, pos * 8, swap16 (seq[vlan]), 16);
+ bitstream_direct_write (p, (pos + ETH_VLANTAG_SIZE) * 8,
+ swap16 (seq[vlan]), 16);
lib_seq_check_packet (&s, (u8 *) p, ETH_PACKET_MAX_SIZE);
test_fail_if (test_seq_check_callback_values.cb_called == true);
seq[vlan]++;
@@ -206,7 +207,8 @@ test_seq_check_packet (test_t t, lib_rnd_t *rnd, uint pos, u16 ethertype)
res = false;
}
test_seq_check_callback_values.cb_called = false;
- bitstream_direct_write (p, pos * 8, swap16 (seq[vlan]), 16);
+ bitstream_direct_write (p, (pos + ETH_VLANTAG_SIZE) * 8,
+ swap16 (seq[vlan]), 16);
lib_seq_check_packet (&s, (u8 *) p, ETH_PACKET_MAX_SIZE);
test_fail_if (test_seq_check_callback_values.cb_called == res);
seq[vlan]++;