diff --git a/CHANGES b/CHANGES index 2474f3c5ac..c0e54f56f9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +2.6-301 | 2019-05-15 10:05:53 -0700 + + * Fix potential race in openflow broker plugin (Jon Siwek, Corelight) + 2.6-300 | 2019-05-15 09:00:57 -0700 * Fixes to DNS lookup, including ref-counting bugs, preventing starvation diff --git a/VERSION b/VERSION index 91de3cddd1..9aeafbe2f3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6-300 +2.6-301 diff --git a/scripts/base/frameworks/openflow/plugins/broker.zeek b/scripts/base/frameworks/openflow/plugins/broker.zeek index f37f0b8afc..e6a594822e 100644 --- a/scripts/base/frameworks/openflow/plugins/broker.zeek +++ b/scripts/base/frameworks/openflow/plugins/broker.zeek @@ -61,8 +61,8 @@ function broker_flow_clear_fun(state: OpenFlow::ControllerState): bool function broker_init(state: OpenFlow::ControllerState) { - Broker::peer(cat(state$broker_host), state$broker_port); Broker::subscribe(state$broker_topic); # openflow success and failure events are directly sent back via the other plugin via broker. + Broker::peer(cat(state$broker_host), state$broker_port); } event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) diff --git a/testing/btest/scripts/base/frameworks/openflow/broker-basic.zeek b/testing/btest/scripts/base/frameworks/openflow/broker-basic.zeek index a7a3113171..b84a337b9f 100644 --- a/testing/btest/scripts/base/frameworks/openflow/broker-basic.zeek +++ b/testing/btest/scripts/base/frameworks/openflow/broker-basic.zeek @@ -2,7 +2,7 @@ # @TEST-EXEC: btest-bg-run recv "zeek -b ../recv.zeek >recv.out" # @TEST-EXEC: btest-bg-run send "zeek -b -r $TRACES/smtp.trace --pseudo-realtime ../send.zeek >send.out" -# @TEST-EXEC: btest-bg-wait 20 +# @TEST-EXEC: btest-bg-wait 30 # @TEST-EXEC: btest-diff recv/recv.out # @TEST-EXEC: btest-diff send/send.out @@ -33,7 +33,6 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) event OpenFlow::controller_activated(name: string, controller: OpenFlow::Controller) { - continue_processing(); OpenFlow::flow_clear(of_controller); OpenFlow::flow_mod(of_controller, [], [$cookie=OpenFlow::generate_cookie(1), $command=OpenFlow::OFPFC_ADD, $actions=[$out_ports=vector(3, 7)]]); } @@ -61,7 +60,9 @@ function got_message() { ++msg_count; - if ( msg_count == 6 ) + if ( msg_count == 2 ) + continue_processing(); + else if ( msg_count == 6 ) terminate(); }