tunnel: Correctly check for internal device.
[openvswitch] / tests / test-classifier.c
index a63b7cab3a94662a033aba9dbd85faed5327e5a9..4227c1822f6e91f22a576b373a81432efd8c8db8 100644 (file)
@@ -352,17 +352,18 @@ lookup_with_include_bits(const struct classifier *cls,
 static void
 compare_classifiers(struct classifier *cls, struct tcls *tcls)
 {
+    static const int confidence = 500;
     unsigned int i;
 
     assert(classifier_count(cls) == tcls->n_rules);
     assert(classifier_count_exact(cls) == tcls_count_exact(tcls));
-    for (i = 0; i < N_FLOW_VALUES; i++) {
+    for (i = 0; i < confidence; i++) {
         struct cls_rule *cr0, *cr1;
         flow_t flow;
         unsigned int x;
         int include;
 
-        x = i;
+        x = rand () % N_FLOW_VALUES;
         flow.nw_src = nw_src_values[get_value(&x, N_NW_SRC_VALUES)];
         flow.nw_dst = nw_dst_values[get_value(&x, N_NW_DST_VALUES)];
         flow.tun_id = tun_id_values[get_value(&x, N_TUN_ID_VALUES)];
@@ -429,7 +430,7 @@ check_tables(const struct classifier *cls,
         if (!hmap_is_empty(&cls->tables[i])) {
             found_tables++;
         }
-        HMAP_FOR_EACH (bucket, struct cls_bucket, hmap_node, &cls->tables[i]) {
+        HMAP_FOR_EACH (bucket, hmap_node, &cls->tables[i]) {
             found_buckets++;
             assert(!list_is_empty(&bucket->rules));
             found_rules += list_size(&bucket->rules);