dd51dae29bccca3 ("ofproto: Move logic for collecting read-only rules into
rule_criteria.") modifies modify_flows__ such that the variable error,
the return value, may be uninitialised if either of the following is true:
1. ofproto->ofproto_class->rule_premodify_actions is NULL
2. rules->n is zero
It appears for the "bfd - Verify tunnel down detection" test
in the testsuite the first condition is true and the test fails.
This commit fixes the problem.
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com changed the style of the fix]
Signed-off-by: Ben Pfaff <blp@nicira.com>
{
struct list dead_cookies = LIST_INITIALIZER(&dead_cookies);
enum nx_flow_update_event event;
- enum ofperr error;
size_t i;
if (ofproto->ofproto_class->rule_premodify_actions) {
for (i = 0; i < rules->n; i++) {
struct rule *rule = rules->rules[i];
+ enum ofperr error;
error = ofproto->ofproto_class->rule_premodify_actions(
rule, fm->ofpacts, fm->ofpacts_len);
learned_cookies_flush(ofproto, &dead_cookies);
if (fm->buffer_id != UINT32_MAX && req) {
- error = send_buffered_packet(req->ofconn, fm->buffer_id,
- rules->rules[0]);
+ return send_buffered_packet(req->ofconn, fm->buffer_id,
+ rules->rules[0]);
}
- return error;
+ return 0;
}
static enum ofperr