summaryrefslogtreecommitdiff
path: root/tests/test-multipath.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2013-10-17 14:28:20 -0700
committerBen Pfaff <blp@nicira.com>2013-10-17 15:08:05 -0700
commit94639963bf275a41e42277116205da0e9b457580 (patch)
treeae1c59faf70461c6c681c287d6f44fe2e675c1b3 /tests/test-multipath.c
parenta5ae88ff8a276e86c842ac102145432662bf711a (diff)
downloadopenvswitch-94639963bf275a41e42277116205da0e9b457580.tar.gz
More accurate wildcarding and fragment handling.
This patch gets rid of the need for having explicit padding in struct flow as new fields are being added. flow_wildcards_init_exact(), which used to set bits in both compiler generated and explicit padding, is removed. match_wc_init() is now used instead, which generates the mask based on a given flow, setting bits only in fields which make sense. Places where random bits were placed in struct flow have been changed to only set random bits on fields that are significant in the given context. This avoids setting padding bits. - lib/flow: - Properly initialize struct flow also in places we used to zero out padding before. - Add flow_random_hash_fields() used for testing. - Remove flow_wildcards_init_exact() to avoid initializing masks where compiler generated padding has bits set. - lib/match.c match_wc_init(): Wildcard transport layer fields for later fragments, remove match_init_exact(), which used flow_wildcards_init_exact(). - tests/test-flows.c: use match_wc_init() instead of match_init_exact() - tests/flowgen.pl: generate more accurate packets and flows when fragmenting, mark unavailable fields as wildcarded. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests/test-multipath.c')
-rw-r--r--tests/test-multipath.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/test-multipath.c b/tests/test-multipath.c
index 4ba36922e..bf879c7a0 100644
--- a/tests/test-multipath.c
+++ b/tests/test-multipath.c
@@ -26,7 +26,6 @@
#include "flow.h"
#include "ofp-actions.h"
-#include "random.h"
#include "util.h"
int
@@ -39,7 +38,6 @@ main(int argc, char *argv[])
int n;
set_program_name(argv[0]);
- random_init();
if (argc != 2) {
ovs_fatal(0, "usage: %s multipath_action", program_name);
@@ -65,7 +63,7 @@ main(int argc, char *argv[])
struct flow_wildcards wc;
struct flow flow;
- random_bytes(&flow, sizeof flow);
+ flow_random_hash_fields(&flow);
mp.max_link = n - 1;
multipath_execute(&mp, &flow, &wc);