[ovs-dev] [PATCH] bundle: Parsing bug when using bracketed syntax.

Ethan Jackson ethan at nicira.com
Thu Oct 27 17:05:33 PDT 2011


This patch fixes the issue and adds a test which would have caught
it.

Reported-by: Michael Mao <mmao at nicira.com>
Bug #8045.
---
 lib/bundle.c       |    2 +-
 tests/ovs-ofctl.at |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/bundle.c b/lib/bundle.c
index ac0bade..af1be63 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -214,7 +214,7 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr,
         ovs_be16 slave_be;
         char *slave;
 
-        slave = strtok_r(NULL, ", ", save_ptr);
+        slave = strtok_r(NULL, ", [", save_ptr);
         if (!slave || n_slaves >= BUNDLE_MAX_SLAVES) {
             break;
         }
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index 25207f6..b5c119f 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -21,6 +21,7 @@ actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
+actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3])
 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
 actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
@@ -50,6 +51,7 @@ NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
+NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
-- 
1.7.7




More information about the dev mailing list