From: Ethan Jackson Date: Thu, 27 Oct 2011 23:58:20 +0000 (-0700) Subject: bundle: Parsing bug when using bracketed syntax. X-Git-Tag: v1.3.0~32 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=5f562a2b0381fc170affb120847c8bd0b90e5543 bundle: Parsing bug when using bracketed syntax. This patch fixes the issue and adds a test which would have caught it. Reported-by: Michael Mao Bug #8045. --- diff --git a/lib/bundle.c b/lib/bundle.c index ac0badef6..af1be6303 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 25207f628..b5c119f35 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)