aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2014-12-08 10:10:07 -0800
committerJarno Rajahalme <jrajahalme@nicira.com>2014-12-08 10:10:07 -0800
commit66e1d95523a98789a5bd9ce40cd1f7b7625f6de6 (patch)
tree21d3006ad68005040ac513f77a2c1b8a7a5ea4a5
parent914624f81740a2502438c6b3c89478597ea78426 (diff)
tests/classifier: Make test work in big-endian systems.
Change a test so that the result will be the same in both little-endian and big-endian systems by editing the test case so that only one bit differs. Reported-by: Mijo Safradin <mijo@linux.vnet.ibm.com> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--lib/classifier.c3
-rw-r--r--tests/classifier.at4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/classifier.c b/lib/classifier.c
index fe43bd17f..1985efea7 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -1336,7 +1336,8 @@ miniflow_and_mask_matches_flow_wc(const struct miniflow *flow,
/* Only unwildcard if none of the differing bits is already
* exact-matched. */
if (!(flow_u32_value(&wc->masks, idx) & diff)) {
- /* Keep one bit of the difference. */
+ /* Keep one bit of the difference. The selected bit may be
+ * different in big-endian v.s. little-endian systems. */
*flow_u32_lvalue(&wc->masks, idx) |= rightmost_1bit(diff);
}
return false;
diff --git a/tests/classifier.at b/tests/classifier.at
index 4d23be50d..eb970229f 100644
--- a/tests/classifier.at
+++ b/tests/classifier.at
@@ -43,9 +43,9 @@ AT_CHECK([tail -2 stdout], [0],
[Megaflow: recirc_id=0,tcp,in_port=2,nw_dst=192.168.0.0/16,nw_frag=no
Datapath actions: 1
])
-AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout])
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=11.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout])
AT_CHECK([tail -2 stdout], [0],
- [Megaflow: recirc_id=0,ip,in_port=1,nw_dst=0.0.0.0/2.0.0.0,nw_frag=no
+ [Megaflow: recirc_id=0,ip,in_port=1,nw_dst=1.0.0.0/1.0.0.0,nw_frag=no
Datapath actions: drop
])
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=10.1.2.15,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout])