[ovs-dev] [PATCH] ofproto: Print "drop" action when dumping hidden flows

Justin Pettit jpettit at nicira.com
Tue Oct 26 21:00:03 UTC 2010


On Oct 21, 2010, at 10:30 AM, Ben Pfaff wrote:

> On Thu, Oct 21, 2010 at 10:11:19AM -0700, Justin Pettit wrote:
>> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
>> index ab5d476..4932d99 100644
>> --- a/ofproto/ofproto.c
>> +++ b/ofproto/ofproto.c
>> @@ -3344,9 +3344,7 @@ flow_stats_ds_cb(struct cls_rule *rule_, void *cbdata_)
>>     ds_put_format(results, "n_packets=%"PRIu64", ", packet_count);
>>     ds_put_format(results, "n_bytes=%"PRIu64", ", byte_count);
>>     ofp_print_match(results, &match, true);
>> -    if (act_len > 0) {
>> -        ofp_print_actions(results, &rule->actions->header, act_len);
>> -    }
>> +    ofp_print_actions(results, &rule->actions->header, act_len);
>>     ds_put_cstr(results, "\n");
> 
> When act_len is 0, rule->actions is NULL, so taking
> &rule->actions->header technically yields undefined behavior.  It is
> probably not too risky, so you are welcome to commit this if you are not
> worried about it.


Thanks for pointing that out.  I'm not comfortable with it, so I just print "drop" directly in flow_stats_ds_cb().  I pushed it that way.

--Justin






More information about the dev mailing list