From: Ethan Jackson Date: Thu, 27 Oct 2011 23:58:20 +0000 (-0700) Subject: bundle: Parsing bug when using bracketed syntax. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db968317f3ab4c44dedd9a125333edaed1924de2;p=openvswitch 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 ac0badef..af1be630 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 25207f62..b5c119f3 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)