[ovs-dev] [PATCH 1/3] tests/ofproto-dpif - fragment handling: Add detail.

Jarno Rajahalme jrajahalme at nicira.com
Wed Oct 29 22:12:00 UTC 2014


Add transport port modifications to the existing frags handling test
case.

This demonstrates incorrect behavior by not moving the destination
port number to source port in normal mode for first fragment, as the
transport port numbers have been zeroed and the move has no effect,
and by allowing moves to/from transport ports on later fragments
(which do not have a transport header).

Next patches fix these problems.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
---
 tests/ofproto-dpif.at |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 652a2a3..33cf2b0 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -3288,12 +3288,12 @@ AT_SETUP([ofproto-dpif - fragment handling])
 OVS_VSWITCHD_START
 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
 AT_DATA([flows.txt], [dnl
-priority=75 tcp ip_frag=no    tp_dst=80 actions=output:1
-priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
-priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
-priority=50 tcp ip_frag=no              actions=output:4
-priority=50 tcp ip_frag=first           actions=output:5
-priority=50 tcp ip_frag=later           actions=output:6
+priority=75 tcp ip_frag=no    tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
+priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
+priority=75 tcp ip_frag=later tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:3
+priority=50 tcp ip_frag=no              actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
+priority=50 tcp ip_frag=first           actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
+priority=50 tcp ip_frag=later           actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:6
 ])
 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
 
@@ -3322,8 +3322,14 @@ do
     : > expout
     if test $mode = drop && test $type != no; then
         echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
+        echo "Datapath actions: $exp_output" >> expout
+    elif test $mode = normal && test $type != no; then
+        echo "Datapath actions: $exp_output" >> expout
+    elif test $mode = nx-match && test $type = later; then
+        echo "Datapath actions: $exp_output" >> expout
+    else
+        echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
     fi
-    echo "Datapath actions: $exp_output" >> expout
     AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
   done
 done
-- 
1.7.10.4




More information about the dev mailing list