Oh, I forgot to remove the warnings from the callers.  I'll do that
before merging.

Ethan

On Fri, Jul 22, 2011 at 15:46, Ben Pfaff <[email protected]> wrote:
> That's what I had in mind, thanks.
>
> On Fri, Jul 22, 2011 at 03:44:18PM -0700, Ethan Jackson wrote:
>> Here is an incremental based on comments on a future patch.
>>
>> ---
>>  lib/nx-match.c |   13 +++++++++----
>>  1 files changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/nx-match.c b/lib/nx-match.c
>> index b382b26..6c48d02 100644
>> --- a/lib/nx-match.c
>> +++ b/lib/nx-match.c
>> @@ -1224,12 +1224,17 @@ nxm_dst_check(ovs_be32 dst_header, ovs_be16 
>> ofs_nbits, size_t min_n_bits,
>>      n_bits = nxm_decode_n_bits(ofs_nbits);
>>      dst = nxm_field_lookup(ntohl(dst_header));
>>
>> -    if (!field_ok(dst, flow, ofs + n_bits) || !dst->writable
>> -        || n_bits < min_n_bits) {
>> -        return BAD_ARGUMENT;
>> +    if (!field_ok(dst, flow, ofs + n_bits)) {
>> +        VLOG_WARN_RL(&rl, "invalid destination field");
>> +    } else if (!dst->writable) {
>> +        VLOG_WARN_RL(&rl, "destination field is not writable");
>> +    } else if (n_bits < min_n_bits) {
>> +        VLOG_WARN_RL(&rl, "insufficient bits in destination");
>> +    } else {
>> +        return 0;
>>      }
>>
>> -    return 0;
>> +    return BAD_ARGUMENT;
>>  }
>>
>>  int
>> --
>> 1.7.6
>>
>> _______________________________________________
>> dev mailing list
>> [email protected]
>> http://openvswitch.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to