[ovs-dev] [tests+nxm-ofctl 23/42] ofp-print: Fix handling of zero-length actions.

Ethan Jackson ethan at nicira.com
Thu Dec 2 22:27:28 UTC 2010


Good*

On Thu, Dec 2, 2010 at 2:27 PM, Ethan Jackson <ethan at nicira.com> wrote:
> Looks God.
>
> On Tue, Nov 23, 2010 at 2:43 PM, Ben Pfaff <blp at nicira.com> wrote:
>> Without this change, zero-length ofp_actions cause an infinite loop.
>> ---
>>  lib/ofp-print.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/ofp-print.c b/lib/ofp-print.c
>> index e3cae78..97fd065 100644
>> --- a/lib/ofp-print.c
>> +++ b/lib/ofp-print.c
>> @@ -314,6 +314,11 @@ ofp_print_action(struct ds *string, const struct ofp_action_header *ah,
>>         return -1;
>>     }
>>
>> +    if (!len) {
>> +        ds_put_format(string, "***zero-length action***\n");
>> +        return 8;
>> +    }
>> +
>>     if ((len % OFP_ACTION_ALIGN) != 0) {
>>         ds_put_format(string,
>>                       "***action %"PRIu16" length not a multiple of %d***\n",
>> --
>> 1.7.1
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>>
>




More information about the dev mailing list